public async Task <int> DeleteAsync(Person person) { _context.Remove(person); var rowsAffected = await _context.SaveChangesAsync(); return(rowsAffected); }
public async Task <IActionResult> Create([FromBody] Bunny bunny) { context.Bunny.Add(bunny); await context.SaveChangesAsync(); var bunnyUri = Url.Link("GetBunny", new { id = bunny.Id }); return(Created(bunnyUri, bunny)); }