Exemplo n.º 1
0
 public ActionResult UpdateLink(LinkHeader linkHeader)
 {
     if (ModelState.IsValid)
     {
         dbContext.Entry(linkHeader).State = EntityState.Modified;
         dbContext.SaveChanges();
         return null;
     }
     else
     {
         return new HttpStatusCodeResult(400, "Lỗi update link header");
     }
 }
Exemplo n.º 2
0
 public ActionResult Creat(LinkHeader linkHeader)
 {
     if (ModelState.IsValid)
     {
         dbContext.LinkHeaders.Add(linkHeader);
         dbContext.SaveChanges();
         //int index = 0;
         //index = dbContext.CatagoryNewss.OrderBy(x => x.CatagoryNewsName).ToList().IndexOf(catagoryNews);
         //return Json(index, JsonRequestBehavior.AllowGet);
         return null;
     }
     return new HttpStatusCodeResult(400, "Lỗi tạo mới link header");
 }