public IHttpActionResult DeleteCrop(int i_CropID) { using (EntitiesNegev4 context = new EntitiesNegev4()) { IHttpActionResult response = Ok(); bool ok = true; try { m_CropHendler.DeleteRow(i_CropID, context); } catch { response = StatusCode(System.Net.HttpStatusCode.ServiceUnavailable); ok = false; } if (ok) { List <ILightWeight> cropToSend = m_CropHendler.GetAllTable(context) as List <ILightWeight>; response = Ok(cropToSend); } return(response); } }
public IHttpActionResult DeleteCrop(int i_CropID) { using (EntitiesNegev4 context = new EntitiesNegev4()) { IHttpActionResult response = Ok(); try { m_CropHendler.DeleteRow(i_CropID, context); } catch { response = BadRequest("could not delete..."); } return(response); } }