public IHttpActionResult InsertResource([FromBody] ResourceModel modelToInsert) { bool isInserted = ResourceManager.InsertResource(ResourceModel.MapEntities(modelToInsert)); if (isInserted) { return(Ok()); } return(BadRequest($"Cannot insert Resource, ID: {modelToInsert.ID}. Check if ID already Exists")); }
public IHttpActionResult UpdateResource([FromBody] ResourceModel model) { bool isModified = ResourceManager.UpdateResource(ResourceModel.MapEntities(model)); if (isModified) { return(Ok()); } return(BadRequest($"Cannot update Resource, ID: {model.ID}. Check parameters")); }