// // GET: /Home/ public ActionResult Index() { User model = null; using (var context = new MyDbContext()) { model = context.Users.Single(); } return View(model); }
public ActionResult GetData() { MyDbContext context = new MyDbContext(); var model = context.Users; int recordCount = context.Users.Count(); var gridData = new { Rows = model, Total = recordCount }; return Json(gridData); }