public ActionResult <OpvangContact> PostOpvangContact(OpvangContact item) { _repo.Create(item); _repo.Save(); return(CreatedAtAction(nameof(GetOpvangContact), new { id = item.Id }, item)); }
public async Task <IActionResult> PutOpvangContact(long id, OpvangContact item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }