// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { AuthenticationConfig.Configure(services, Configuration); BlazorConfig.Configure(services, Configuration); DependencyInjectionConfig.Configure(services, Configuration); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddDbContext <TDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("TDbContext"))); // Register the Swagger generator, defining 1 or more Swagger documents services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); }); AuthenticationConfig.Configure(services, Configuration); DependencyRegistrar.Register(services); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { MvcConfig.Configure(app, env); AuthenticationConfig.Configure(app, env); BlazorConfig.Configure(app, env); }