public JsonResult StudentByID(int?id) { using (CRUDDbContext db = new CRUDDbContext()) { return(Json(db.Employees.Where(x => x.EmployeeID == id).ToList(), JsonRequestBehavior.AllowGet)); } }
public JsonResult ListStudent() { using (CRUDDbContext db = new CRUDDbContext()) { return(Json(db.Employees.ToList(), JsonRequestBehavior.AllowGet)); } }
public ActionResult GetData() { using (CRUDDbContext db = new CRUDDbContext()) { List <Employee> employees = db.Employees.ToList <Employee>(); return(Json(new { data = employees }, JsonRequestBehavior.AllowGet)); } }
public EmployeeRepository(CRUDDbContext context) { _dbContext = context; }
public EmployeeRepository() { _dbContext = new CRUDDbContext(); }