public Color DeleteColor(int ID) { if (ID <= 0) { throw new ArgumentException("Incorrect ID entered"); } if (GetColorByID(ID) == null) { throw new ArgumentException("No color with such ID found"); } return(ColorRepository.DeleteColor(ID)); }
public HttpResponseMessage Delete([FromBody] Models.color color) { try { //long con_id = long.Parse(country_id); bool updatCountry = colorRepository.DeleteColor(color.color_id); var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "success", msg = "Color Delete Successfully." }, formatter)); } catch (Exception ex) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "error", msg = ex.ToString() }, formatter)); } }
public void DeleteColor(int id) { colorRepository.DeleteColor(id); }
public void DeleteColor(int id) { colorRepo.DeleteColor(id); }
public bool DeleteColor(Color color) { return(colorRepository.DeleteColor(color)); }