public async Task <IActionResult> PutTypeContact(int id, TypeContact typeContact) { if (id != typeContact.Id) { return(BadRequest()); } _context.Entry(typeContact).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeContactExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TypeContact> > PostTypeContact(TypeContact typeContact) { _context.TypeContacts.Add(typeContact); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTypeContact", new { id = typeContact.Id }, typeContact)); }
public void SetTypeContact(TypeContact typeContact) { this.typeContact = typeContact; }