public async Task <IActionResult> Edit(Student model) { studentRepo = new StudentRepo(); await studentRepo.Update(model); return(View()); }
public async Task <IActionResult> Create(Student model) { studentRepo = new StudentRepo(); await studentRepo.Add(model); return(View()); }
public async Task <IActionResult> Delete(long id) { studentRepo = new StudentRepo(); await studentRepo.Delete(id); return(View()); }
public BaseApplication( IEmailSender _emailSender, LocalDbContext _ldbc, EntityDbContext _edbc, ExamsDbContext _xdbc, IModuleRepo _moduleRepo, IAppDetails _app, IModuleMarkRepo _moduleMarkRepo, IModuleMarkChangeLogRepo _moduleMarkChangeLogRepo, ICMPMarksImportRepo _cmpMarksImportRepo, TestDbContext _tdbc, IStudentRepo _studentRepo ) { emailSender = _emailSender; ldbc = _ldbc; edbc = _edbc; tdbc = _tdbc; xdbc = _xdbc; moduleRepo = _moduleRepo; moduleMarkRepo = _moduleMarkRepo; moduleMarkChangeLogRepo = _moduleMarkChangeLogRepo; app = _app; cmpMarksImportRepo = _cmpMarksImportRepo; //Test cases studentRepo = _studentRepo; }
public StudentController(IStudentRepo iStudentRepo,IAutogearRepo autogearRepo,IPostalRepo postalRepo,IInstructorRepo instructorRepo) { _iStudentRepo = iStudentRepo; _iAutogearRepo = autogearRepo; _iPostalRepo = postalRepo; _instructorRepo = instructorRepo; }
public StudentController(IStudentRepo repo, IHttpContextAccessor accessor) { studentRepo = repo; //get the userId out of the token and set the userid in the repo httpCtx = accessor; studentRepo.loggedInUserId = int.Parse(httpCtx.HttpContext.User.Claims.First(c => c.Type == "sub").Value); }
public AutogearApiController(IInstructorRepo instructorRepo, IStudentRepo studentRepo, IPostalRepo postalRepo, ApplicationUserManager userManager) { _instructorRepo = instructorRepo; _studentRepo = studentRepo; _postalRepo = postalRepo; _userManager = userManager; }
public HomeController(IStudentRepo employeeRepo, IHostingEnvironment henv, IGuarantorRepo guarantorRepo, IPayment payment, IProgramCourses programCourses) { this._er = employeeRepo; this.henv = henv; this._guarantorRepo = guarantorRepo; this._payment = payment; this._programcourse = programCourses; }
public LessonController(ApplicationUserManager userManager, ApplicationRoleManager roleManager, IInstructorRepo instructorRepo, IPostalRepo postalRepo, IAutogearRepo autogearRepo, IStudentRepo studentRepo) { _userManager = userManager; _roleManager = roleManager; _instructorRepo = instructorRepo; _postalRepo = postalRepo; _autogearRepo = autogearRepo; _studentRepo = studentRepo; }
public async Task <IActionResult> Index() { studentRepo = new StudentRepo(); //get all data var getalldata = studentRepo.GetAll(); //get single data var singledata = await studentRepo.Get(1); return(View()); }
public void GetStudent_ShouldReturnBadRequest() { //Arrange testSchoolRegisterContext = new TestSchoolRegisterContext(); studentRepo = new MockStudentRepo(testSchoolRegisterContext); studentsController = new StudentsController(studentRepo); //Act IHttpActionResult actionResult = studentsController.GetStudent(null); //Assert Assert.IsInstanceOfType(actionResult, typeof(BadRequestResult)); }
public void GetCoursesByStudentId_ShouldReturnNotFound() { // Arrange testSchoolRegisterContext = new TestSchoolRegisterContext(); studentRepo = new MockStudentRepo(testSchoolRegisterContext); studentsController = new StudentsController(studentRepo); //Act IHttpActionResult actionResult = studentsController.GetCoursesByStudentId("sampleStudentId"); //Assert Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult)); }
public void GetStudent_ShouldReturnForbidden() { //Arrange testSchoolRegisterContext = new TestSchoolRegisterContext(); studentRepo = new MockStudentRepo(testSchoolRegisterContext); studentsController = new StudentsController(studentRepo); PopulateStudentFields(); //Act var actionResult = studentsController.GetStudent("unauthenticatedStudentId") as ResponseMessageResult; //Assert Assert.IsNotNull(actionResult); Assert.AreEqual(actionResult.Response.StatusCode, HttpStatusCode.Forbidden); }
public void GetStudent_ShouldReturnNotFound() { //Arrange testSchoolRegisterContext = new TestSchoolRegisterContext(); studentRepo = new MockStudentRepo(testSchoolRegisterContext); studentsController = new StudentsController(studentRepo); PopulateStudentFields(); //Act var actionResult = studentsController.GetStudent("notExistingStudentId"); //Assert Assert.IsNotNull(actionResult); Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult)); }
public void PutStudent_ShouldReturnBadRequestDifferentId() { // Arrange testSchoolRegisterContext = new TestSchoolRegisterContext(); studentRepo = new MockStudentRepo(testSchoolRegisterContext); studentsController = new StudentsController(studentRepo); //Act IHttpActionResult actionResult = studentsController.PutStudent("notExistingStudentId", new Student { Id = "sampleStudentId" }); //Assert Assert.IsInstanceOfType(actionResult, typeof(BadRequestResult)); }
public void GetStudent_ShouldReturnOk() { //Arrange testSchoolRegisterContext = new TestSchoolRegisterContext(); studentRepo = new MockStudentRepo(testSchoolRegisterContext); studentsController = new StudentsController(studentRepo); PopulateStudentFields(); //Act var actionResult = studentsController.GetStudent("sampleStudentId"); var contentResult = actionResult as OkNegotiatedContentResult <StudentBasicDto>; // Assert Assert.IsNotNull(contentResult); Assert.IsNotNull(contentResult.Content); Assert.AreEqual("sampleStudentId", contentResult.Content.Id); }
public StudentService(IStudentRepo objStudentRepo) { _StudentRepo = objStudentRepo; }
public StudentService(IStudentRepo repository) { _repository = repository; }
public UoW(SchoolContext schoolContext, IStudentRepo studentRepo, ICourseRepo courseRepo) { this.schoolContext = schoolContext; this.studentRepo = studentRepo; this.courseRepo = courseRepo; }
public StudentService(IStudentRepo _studentRepo) { this.studentRepo = _studentRepo; }
public HomeController(IStudentRepo employeeRepo, IHostingEnvironment henv) { _er = employeeRepo; this.henv = henv; }
public CommandsController(IStudentRepo repository) { _repository = repository; }
public PayController(IPaymentRepo repo, IStudentRepo studentrepo) { payRepo = repo; student_repo = studentrepo; }
public StudentsController(IStudentRepo repo) { _repo = repo; }
//private readonly MockStudentRepo _repository = new MockStudentRepo(); public StudentsController(IStudentRepo repository, IMapper mapper) { _repository = repository; _mapper = mapper; }
public StudentsController(IStudentRepo repo, IHostingEnvironment host) { _repo = repo; _host = host; }
public StudentController(IStudentRepo repository, IMapper mapper) //Dependency Injection { _repository = repository; _mapper = mapper; }
public UnitOfWork(IStudentRepo StudentRepo, ArchitectureEntities db) { _StudentRepo = StudentRepo; _db = db; }
public StudentsController(IStudentRepo repo, IMapper mapper) { this._repo = repo; _mapper = mapper; }
public StudentsController(IStudentRepo db) { this._db = db; }
public StudentsController(NewAndNotificationContext context, IStudentRepo repository, IMapper mapper) { _context = context; _repository = repository; _mapper = mapper; }
public StudentService(IStudentRepo studentRepo) { _studentRepo = studentRepo; }
public StudentsController(IStudentRepo <Students> studentRepo) { _studentRepo = studentRepo; }