public async Task <IActionResult> CreateContactType([FromBody] Person.ContactType value) { _db.Person_ContactType.Add(value); await _db.SaveChangesAsync(); return(Ok(value)); }
public async Task <IActionResult> EditContactType(int contactTypeID, [FromBody] Person.ContactType value) { var existing = await _db.Person_ContactType.FirstOrDefaultAsync(x => x.ContactTypeID == contactTypeID); if (existing == null) { return(NotFound()); } existing.ContactTypeID = value.ContactTypeID; existing.Name = value.Name; existing.ModifiedDate = value.ModifiedDate; _db.Person_ContactType.Update(existing); await _db.SaveChangesAsync(); return(NoContent()); }