示例#1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                dbContext?.Dispose();
            }

            base.Dispose(disposing);
        }
示例#2
0
 /// <summary>
 /// Releases the unmanaged resources used by the <see cref="MainController"/> object and optionally releases the managed resources.
 /// </summary>
 /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
 protected override void Dispose(bool disposing)
 {
     if (!m_disposed)
     {
         try
         {
             if (disposing)
             {
                 m_dataContext?.Dispose();
                 m_appModel?.Dispose();
             }
         }
         finally
         {
             m_disposed = true;          // Prevent duplicate dispose.
             base.Dispose(disposing);    // Call base class Dispose().
         }
     }
 }