public async Task DeleteBeer(int beerId) { var beer = await Beers.FirstAsync(b => b.Id == beerId); Beers.Remove(beer); await SaveChangesAsync(); }
public void DeleteBeer(Beer beer) { if (!Beers.Contains(beer)) { throw new ArgumentException($"{beer.Name} is not a {Name} beer"); } Beers.Remove(beer); }
/// <inheritdoc /> public async Task DeleteBeerAsync(Beer beer) { Beers.Remove(beer); await SaveChangesAsync(); }