public async Task <IActionResult> PutPublisher([FromRoute] int id, [FromBody] Publisher publisher) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != publisher.Id) { return(BadRequest()); } _context.Entry(publisher).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PublisherExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Task SaveChangesAsync() { return(_context.SaveChangesAsync()); }