// This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            InfrastructureModule.Register(services,
                                          Configuration.GetConnectionString("DefaultConnection"),
                                          GetType().Assembly.FullName);

            BusinessLogicModule.Register(services);

            ApplicationServiceModule.Register(services);

            services.AddDefaultIdentity <User>()
            .AddEntityFrameworkStores <ApplicationDbContext>();

            services.AddAutoMapper();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info
                {
                    Version        = "v1",
                    Title          = "ASP.Net Core Startup Project",
                    Description    = "Ready Made Repository Pattern for you to build on",
                    TermsOfService = "None",
                    Contact        = new Contact()
                    {
                        Name = "Coding_Maestro", Email = "folidominic97@gmail", Url = "https://www.linkedin.com/in/dominic-foli-8275b4136/"
                    }
                });
            });
        }
Esempio n. 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            InfrastructureModule.Register(services,
                                          Configuration.GetConnectionString("DefaultConnection"),
                                          GetType().Assembly.FullName);

            BusinessLogicModule.Register(services);

            ApplicationServiceModule.Register(services);

            services.AddDefaultIdentity <User>()
            .AddEntityFrameworkStores <ApplicationDbContext>();
            services.AddAutoMapper();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }