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