示例#1
0
 //
 // GET: /Home/
 public ActionResult Index()
 {
     User model = null;
     using (var context = new MyDbContext())
     {
         model = context.Users.Single();
     }
     return View(model);
 }
示例#2
0
        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);
        }