Beispiel #1
0
 public Task Delete(CounterState state)
 {
     if (_counterStates.ContainsKey(state.Id))
     {
         _counterStates.Remove(state.Id);
     }
     return(Task.CompletedTask);
 }
Beispiel #2
0
 public Task Update(CounterState state)
 {
     if (_counterStates.TryGetValue(state.Id, out var existingState))
     {
         existingState.Count     = state.Count;
         existingState.CreatedAt = state.CreatedAt;
     }
     return(Task.CompletedTask);
 }
 public Task Delete(CounterState state)
 {
     _dbContext.CounterStates.Remove(state);
     return(_dbContext.SaveChangesAsync());
 }
 public Task Update(CounterState state)
 {
     _dbContext.CounterStates.Update(state);
     return(_dbContext.SaveChangesAsync());
 }
 public Task Add(CounterState state)
 {
     _dbContext.CounterStates.Add(state);
     return(_dbContext.SaveChangesAsync());
 }
Beispiel #6
0
 public Task Add(CounterState state)
 {
     _counterStates.Add(state.Id, state);
     return(Task.CompletedTask);
 }