protected override void Dispose(bool disposing) { if (disposing) { dbContext?.Dispose(); } base.Dispose(disposing); }
/// <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(). } } }