Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "CoreCrud.WebApi", Version = "v1"
                });
            });

            DependencyInjectionsManager.Declare(services, _configuration);
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <IdentityCoreCrudDbContext>(options =>
                                                              options.UseSqlServer(_configuration.GetConnectionString("IdentityConnection")));

            services.AddDatabaseDeveloperPageExceptionFilter();

            services.AddDefaultIdentity <IdentityUser>(options =>
            {
                options.SignIn.RequireConfirmedAccount = true;
            })
            .AddEntityFrameworkStores <IdentityCoreCrudDbContext>();
            services.AddControllersWithViews();

            DependencyInjectionsManager.Declare(services);
        }