public IHttpActionResult PostAdd(Unit item) { if (!ModelState.IsValid) return BadRequest(ModelState); unitManagement.Insert(item); return Ok(); }
public IHttpActionResult PutUpdate(Guid id, Unit item) { if (!ModelState.IsValid) return BadRequest(ModelState); if (id != item.Id) return BadRequest(); IList<ServiceError> errors = unitManagement.Update(item); return HandleErrors(errors); }