When using the extension method ExecuteAndCommitAsync<T>(IUnitOfWork, Func<Task<T>>), if the commit is invoked inside the lambda, the method wont return, making a possible dead lock.
Example:
return Created(await _uow.ExecuteAndCommitAsync(async () =>
{
var userIdentity = User.Identity.Name;
entity.CreatedBy(userIdentity);
entity.IndustryAgent = industryAgent;
entity.RetailAgent = retailAgent;
entity.Pharmacy = pharmacy;
entity.Product = product;
entity.Id = Guid.NewGuid();
entity = await _uow.Orders.AddAsync(entity, ct);
await _uow.CommitAsync(ct);
return entity;
}, ct)); // won't return, possible a dead lock
When using the extension method
ExecuteAndCommitAsync<T>(IUnitOfWork, Func<Task<T>>), if the commit is invoked inside the lambda, the method wont return, making a possible dead lock.Example: