@@ -13,7 +13,12 @@ namespace NHibernate.Action
1313 /// instance.
1414 /// </summary>
1515 [ 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
1722 {
1823 private readonly string entityName ;
1924 private readonly object id ;
@@ -102,26 +107,26 @@ public void BeforeExecutions()
102107
103108 public abstract void Execute ( ) ;
104109
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+
125130 protected virtual bool NeedsAfterTransactionCompletion ( )
126131 {
127132 return persister . HasCache || HasPostCommitEventListeners ;
@@ -180,5 +185,15 @@ public override string ToString()
180185 {
181186 return StringHelper . Unqualify ( GetType ( ) . FullName ) + MessageHelper . InfoString ( entityName , id ) ;
182187 }
188+
189+ public void ExecuteBeforeTransactionCompletion ( )
190+ {
191+ BeforeTransactionCompletionProcessImpl ( ) ;
192+ }
193+
194+ public void ExecuteAfterTransactionCompletion ( bool success )
195+ {
196+ AfterTransactionCompletionProcessImpl ( success ) ;
197+ }
183198 }
184199}
0 commit comments