protected override void Dispose(bool disposing) { if (disposing) { _smsservice.Dispose(); } base.Dispose(disposing); }
private bool disposed = false; // To detect redundant calls protected override void Dispose(bool disposing) { if (!disposed) { if (disposing) { // TODO: dispose managed state (managed objects) dbContext.Dispose(); smsService.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposed = true; base.Dispose(disposing); } }