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"); } }
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"); }