public IHttpActionResult SaveComplaint(Complaint C) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } else { IComplaint obj = new ComplaintRepository(); obj.SaveComplaint(C); return(Ok()); } }