// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider service, RoleManager <IdentityRole> roleManager, UserManager <Areas.Identity.Data.VisifyUser> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); EnvironmentVariableService.PopulateEnvironmentVariables(); DatabaseService.ScaffoldTables().Wait(); DatabaseSeedService s = new DatabaseSeedService(roleManager, userManager); s.Seed().Wait(); }
public void Configure(IWebHostBuilder builder) { EnvironmentVariableService.PopulateEnvironmentVariables(); builder.ConfigureServices((context, services) => { services.AddDbContext <VisifyContext>(options => options.UseSqlite(AppConstants.ConnectionString)); //context.Configuration.GetConnectionString("VisifyContextConnection"))); services.AddIdentity <VisifyUser, IdentityRole>((x) => { x.Password.RequiredLength = 4; x.Password.RequiredUniqueChars = 0; x.Password.RequireNonAlphanumeric = false; x.Password.RequireDigit = false; x.Password.RequireLowercase = false; x.Password.RequireUppercase = false; x.User.AllowedUserNameCharacters = null; }) .AddDefaultUI() .AddDefaultTokenProviders() .AddEntityFrameworkStores <VisifyContext>(); }); }
public static (int, IQueryable <Health>) Search(DatabaseContext context, bool isInfected, EnvironmentVariableService ev, int courseId, string filterString, int?page = null, int?numPerPage = null) { var course = context.Courses.Include(x => x.StudentAssignments).ThenInclude(x => x.Student).Where(x => x.Id == courseId).FirstOrDefault(); var students = course.StudentAssignments.Select(x => x.Student.Account); var fc = new FilterCompiler(filterString); return(fc.Filtering(context, isInfected, courseId, ev.GetTimeFrames(), course.StartDate, course.NumOfDaysToSearch)); }
public CsvController(DatabaseService db, EnvironmentVariableService ev) { DB = db; EV = ev; }