@@ -13,7 +13,12 @@ namespace NHibernate.Action
13
13
/// instance.
14
14
/// </summary>
15
15
[ Serializable ]
16
- public abstract partial class EntityAction : IExecutable , IComparable < EntityAction > , IDeserializationCallback
16
+ public abstract partial class EntityAction :
17
+ IAsyncExecutable ,
18
+ IBeforeTransactionCompletionProcess ,
19
+ IAfterTransactionCompletionProcess ,
20
+ IComparable < EntityAction > ,
21
+ IDeserializationCallback
17
22
{
18
23
private readonly string entityName ;
19
24
private readonly object id ;
@@ -102,26 +107,26 @@ public void BeforeExecutions()
102
107
103
108
public abstract void Execute ( ) ;
104
109
105
- public virtual BeforeTransactionCompletionProcessDelegate BeforeTransactionCompletionProcess
106
- {
107
- get
108
- {
109
- return NeedsBeforeTransactionCompletion ( )
110
- ? new BeforeTransactionCompletionProcessDelegate ( BeforeTransactionCompletionProcessImpl )
111
- : null ;
112
- }
113
- }
114
-
115
- public virtual AfterTransactionCompletionProcessDelegate AfterTransactionCompletionProcess
116
- {
117
- get
118
- {
119
- return NeedsAfterTransactionCompletion ( )
120
- ? new AfterTransactionCompletionProcessDelegate ( AfterTransactionCompletionProcessImpl )
121
- : null ;
122
- }
123
- }
124
-
110
+ //Since v5.2
111
+ [ Obsolete ( "This property is not used and will be removed in a future version." ) ]
112
+ public virtual BeforeTransactionCompletionProcessDelegate BeforeTransactionCompletionProcess =>
113
+ NeedsBeforeTransactionCompletion ( )
114
+ ? BeforeTransactionCompletionProcessImpl
115
+ : default ( BeforeTransactionCompletionProcessDelegate ) ;
116
+
117
+ //Since v5.2
118
+ [ Obsolete ( "This property is not used and will be removed in a future version." ) ]
119
+ public virtual AfterTransactionCompletionProcessDelegate AfterTransactionCompletionProcess =>
120
+ NeedsAfterTransactionCompletion ( )
121
+ ? AfterTransactionCompletionProcessImpl
122
+ : default ( AfterTransactionCompletionProcessDelegate ) ;
123
+
124
+ IBeforeTransactionCompletionProcess IAsyncExecutable . BeforeTransactionCompletionProcess =>
125
+ NeedsBeforeTransactionCompletion ( ) ? this : null ;
126
+
127
+ IAfterTransactionCompletionProcess IAsyncExecutable . AfterTransactionCompletionProcess =>
128
+ NeedsAfterTransactionCompletion ( ) ? this : null ;
129
+
125
130
protected virtual bool NeedsAfterTransactionCompletion ( )
126
131
{
127
132
return persister . HasCache || HasPostCommitEventListeners ;
@@ -180,5 +185,15 @@ public override string ToString()
180
185
{
181
186
return StringHelper . Unqualify ( GetType ( ) . FullName ) + MessageHelper . InfoString ( entityName , id ) ;
182
187
}
188
+
189
+ public void ExecuteBeforeTransactionCompletion ( )
190
+ {
191
+ BeforeTransactionCompletionProcessImpl ( ) ;
192
+ }
193
+
194
+ public void ExecuteAfterTransactionCompletion ( bool success )
195
+ {
196
+ AfterTransactionCompletionProcessImpl ( success ) ;
197
+ }
183
198
}
184
199
}
0 commit comments