public User GetUserDetail(int userId) { using (var _context = new RepoDBContext()) { return(_context.User.Where(m => m.id == userId).FirstOrDefault()); } }
public HomeController(RepoDBContext dBContext) { contex = dBContext; }
//MVC will create dbcontext and hand it to the controller's constructor public FileController(RepoDBContext dbContext, IHostingEnvironment hostingEnvironment) { context = dbContext; environment = hostingEnvironment; }
//MVC will create dbcontext and hand it to the controller's constructor public UserController(RepoDBContext dbContext) { context = dbContext; }
//MVC will initiate dbContext and hand control to the constructor public EventController(RepoDBContext dbContext) { context = dbContext; }
public GradeController(RepoDBContext dBContext) { context = dBContext; }