Skip to content

Instantly share code, notes, and snippets.

@oguzhankircali
Last active March 16, 2019 12:31
Show Gist options
  • Save oguzhankircali/bbc6470ad45846c44880b9f3e2055834 to your computer and use it in GitHub Desktop.
Save oguzhankircali/bbc6470ad45846c44880b9f3e2055834 to your computer and use it in GitHub Desktop.
//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