You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.
Trevor Pilley edited this page Mar 16, 2020
·
8 revisions
The AutoManageTransactionAttribute will ensure that an action is wrapped in a transaction if your controller inherits from MicroLiteController/MicroLiteReadOnlyController or implements IAsyncSession/IHaveReadOnlySession.
It will then ensure that the transaction is either rolled back or committed depending on whether the action results in an exception being thrown or not.
If you have registered an AutoManageTransactionAttribute in the global filters collection, there may be times when you may want to manually manage the transaction so it is easy to opt out per controller:
// Will affect all methods in the controller[AutoManageTransaction(AutoManageTransaction=false)]publicclassCustomerController:MicroLiteApiController{ ...}
or per action:
// Will only affect individual methods[AutoManageTransaction(AutoManageTransaction=false)]publicHttpResponseMessageEdit(intid,Modelmodel){ ...}