コード例 #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && AppUserManager != null)
            {
                AppUserManager.Dispose();
            }
            if (disposing && AppRoleManager != null)
            {
                AppRoleManager.Dispose();
            }

            base.Dispose(disposing);
        }
コード例 #2
0
 public virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             userManager.Dispose();
             roleManager.Dispose();
             db.Dispose();
         }
         this.disposed = true;
     }
 }
コード例 #3
0
ファイル: UnitOfWork.cs プロジェクト: StruninIhor/SimpleForum
        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;
            }
        }