// GET: CreateSession public CreateSessionController(IExamSessionManager _examsession, IListManager _list, IHttpContextAccessor HttpContextProp, IHostingEnvironment _env) { this.examsession = _examsession; this.statusList = _list.GetExamStatuses().Data.Select(s => new SelectListItem { Text = s.Name, Value = Convert.ToString(s.Id) }).ToList(); this.sourceList = _list.GetSources().Data.Select(s => new SelectListItem { Text = s.Name, Value = Convert.ToString(s.Id) }).ToList(); this.testList = _list.GetExams().Data.Select(e => new SelectListItem { Text = e.TestTitle, Value = e.TestId.ToString() }).ToList(); this.activeExamList = _list.GetExams().Data.Where(k => k.IsActive == true).Select(e => new SelectListItem { Text = e.TestTitle, Value = e.TestId.ToString() }).ToList(); currentContext = HttpContextProp; env = _env; }
public CreateSessionApiController(IExamSessionManager _examsession, IHttpContextAccessor _currentContext, IHostingEnvironment _env) { this.examsession = _examsession; this.currentContext = _currentContext; this.env = _env; }