Last active
March 16, 2019 12:31
-
-
Save oguzhankircali/bbc6470ad45846c44880b9f3e2055834 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TR: Bu metodu çağıran metotlarda rollback olduğundan, loglamayı etkilemesin diye RequiresNew attribute'u ekleniyor. | |
//Bu sayede metodun bitmesini beklemeden commit etmiş oluyor | |
//EN: Parent method of this have rollback features, but i want to log it, | |
//because of this i added TransactionScopeOption.RequiresNew to unit of work | |
var unitOfWorkManager = IocManager.Instance.Resolve<IUnitOfWorkManager>(); | |
using (var unitOfWork = unitOfWorkManager.Begin(System.Transactions.TransactionScopeOption.RequiresNew)) | |
{ | |
_serviceLogManager.InsertOrUpdateAndGetId(this.ServiceLogEntity); | |
unitOfWork.Complete(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment