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