public async Task <ActionResult> Put(string id, PizzaVotes model) { var exists = await _dbContext.PizzaVotes.AnyAsync(f => f.Id == id); if (!exists) { return(NotFound()); } _dbContext.PizzaVotes.Update(model); await _dbContext.SaveChangesAsync(); return(Ok()); }
public async Task Post(PizzaVotes model) { await _dbContext.AddAsync(model); await _dbContext.SaveChangesAsync(); }