public async Task <ActionResult <TbWebContact> > PostTbWebContact(TbWebContact tbWebContact) { _context.TbWebContact.Add(tbWebContact); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTbWebContact", new { id = tbWebContact.WebcontactId }, tbWebContact)); }
public async Task <IActionResult> PutTbWebContact(int id, TbWebContact tbWebContact) { if (id != tbWebContact.WebcontactId) { return(BadRequest()); } _context.Entry(tbWebContact).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbWebContactExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }