public ActionResult Edit(JobPositionViewModel model) { if (ModelState.IsValid) { Responses responses = (JobPositionRepo.Update(model)); if (responses.Success) { return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = responses.Message }, JsonRequestBehavior.AllowGet)); } } return(Json(new { success = false, message = "Invalid" }, JsonRequestBehavior.AllowGet)); }
// PUT api/<controller>/5 public Responses Put(int id, [FromBody] JobPositionViewModel entity) { entity.Id = id; return(JobPositionRepo.Update(entity)); }
// POST api/<controller> public Responses Post([FromBody] JobPositionViewModel entity) { return(JobPositionRepo.Update(entity)); }