Beispiel #1
0
        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)));
        }
Beispiel #2
0
        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)));
        }