Hi, I see below code in CustomerController:
protected override void Dispose(bool disposing)
protected override void Dispose(bool disposing)
{
if (disposing)
{
_unitOfWorkAsync.Dispose();
}
base.Dispose(disposing);
}
Also I see the code in UnityConfig .RegisterType<IDataContextAsync, NorthwindContext>(new PerRequestLifetimeManager())
.RegisterType<IUnitOfWorkAsync, UnitOfWork>(new PerRequestLifetimeManager())
As the life cycle for IDataContextAsync and IUnitOfWorkAsync is per request, why we still need to dispose in controller? for thread safe?