public ActionResult UpdateLink(Link link) { var response = new ResponseWithValidation(); JsonValidation.GetJsonWithValidation(ModelState, ref response); if (ModelState.IsValid) { _linkRepository.UpdateLink(link); } return(Json(JsonConvert.SerializeObject(response))); }
public ActionResult AddLink(Link link) { var response = new ResponseWithValidation(); JsonValidation.GetJsonWithValidation(ModelState, ref response); if (ModelState.IsValid) { Link addedLink = _linkRepository.AddLink(link); response.Data = addedLink; } return(Json(JsonConvert.SerializeObject(response))); }