protected override void Dispose(bool disposing) { if (disposing && AppUserManager != null) { AppUserManager.Dispose(); } if (disposing && AppRoleManager != null) { AppRoleManager.Dispose(); } base.Dispose(disposing); }
public virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { userManager.Dispose(); roleManager.Dispose(); db.Dispose(); } this.disposed = true; } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { userManager.Dispose(); roleManager.Dispose(); //clientManager } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }