public async Task <ActionResult> PutLink(int id, Link link) { if (id != link.ID) { return(NotFound()); } _context.Entry(link).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LinkExists(id)) { return(NotFound()); } return(Conflict()); } return(NoContent()); }
public async Task CreateAsync(TEntity entity) { await _entities.AddAsync(entity); await _dbContext.SaveChangesAsync(); }