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