static void Main(string[] args) { string[] jsonPath = { "/../../../../RCCS.DatabaseAPI/appsettings.json" }; DesignTimeRCCSUsersContextFactory rccsContextFactory = new DesignTimeRCCSUsersContextFactory(); using RCCSUsersContext context = rccsContextFactory.CreateDbContext(jsonPath); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, RCCSUsersContext usersContext, RCCSContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "RCCS.DatabaseAPI V1"); c.RoutePrefix = string.Empty; }); app.UseHttpsRedirection(); app.UseRouting(); app.UseCors(x => x //.AllowAnyOrigin() // Not allowed together with AllowCredential //.WithOrigins("http://localhost:8080", "http://localhost:5000" ) .SetIsOriginAllowed(x => _ = true) .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials() ); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); DataSeederUsers.SeedUsers(usersContext); DataSeeder.SeedCitizenResidencyDb(context); }
public UserController(RCCSUsersContext context, IOptions <AppSettings> appSettings) { _context = context; _appSettings = appSettings.Value; }
public UserController(RCCSUsersContext context) { _context = context; }