public async Task <IActionResult> PostEntityEmailAddressType([FromBody] EntityEmailAddressType entityEmailAddressType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.EntityEmailAddressTypes.Add(entityEmailAddressType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEntityEmailAddressType", new { id = entityEmailAddressType.Id }, entityEmailAddressType)); }
public async Task <IActionResult> PutEntityEmailAddressType([FromRoute] int id, [FromBody] EntityEmailAddressType entityEmailAddressType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != entityEmailAddressType.Id) { return(BadRequest()); } _context.Entry(entityEmailAddressType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EntityEmailAddressTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }