public async Task <IActionResult> Post([FromBody] Chore chore) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Chores.Add(chore); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(Get), new { id = chore.Id }, chore)); }
public async Task SaveChangesAsync() { await _dbContext.SaveChangesAsync(); }