/// <inheritdoc /> public void Dispose() { if (context != null) { context.Dispose(); context = null; } }
/// <inheritdoc /> public void Dispose() { if (dataContext != null) { dataContext.Dispose(); dataContext = null; } }
/// <inheritdoc /> public async Task InitializeDatabaseAsync() { if (_context != null) { throw new InvalidOperationException(); } _context = new CashDeskDataContext(); await _context.SaveChangesAsync(); }
/// <inheritdoc /> public Task InitializeDatabaseAsync() { if (dataContext != null) { throw new InvalidOperationException("Context already initialized"); } dataContext = new CashDeskDataContext(); return(Task.CompletedTask); }
/// <inheritdoc /> public Task InitializeDatabaseAsync() { if (context == null) { context = new CashDeskDataContext(); } else { throw new InvalidOperationException("Error: Already initialized!"); } return(Task.CompletedTask); }