Beispiel #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(options =>
            {
                options.AddPolicy("AllowAll",
                                  builder =>
                {
                    builder.AllowAnyOrigin()
                    .AllowAnyMethod()
                    .AllowAnyHeader();
                });
            });


            services.AddControllers();

            Configdependecyinjection.Setup(services, Configuration);
            DataDiConfig.Setup(services, Configuration);
            ConfigureDi.Setup(services);
            services.AddAutoMapper(typeof(AutoMapperProfile));
            //Auth
            JwtAuthConfig.Setup(services, Configuration);

            //services.AddDirectoryBrowser();
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(o => o.AddPolicy("LoginCors", builder =>
            {
                builder.AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader();
            }));

            services.AddControllers();
            JwtAuthConfig.Setup(services, Configuration);
            var mapperConfig = new MapperConfiguration(t => {
                t.AddProfile(new AutoMapperProfile());
            });
            IMapper mapper = mapperConfig.CreateMapper();

            services.AddSingleton(mapper);
            services.UserShopService();
            services.AddDbContext <ShopDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"), b => b.MigrationsAssembly("Domain")));
        }
Beispiel #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(o => o.AddPolicy("TestCors", builder =>
            {
                builder.AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader();
            }));


            services.AddControllers();

            Configdependecyinjection.Setup(services, Configuration);
            DataDiConfig.Setup(services, Configuration);
            ConfigureDi.Setup(services);

            //Auth
            JwtAuthConfig.Setup(services, Configuration);

            //services.AddDirectoryBrowser();
        }
Beispiel #4
0
 // 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.UserGiantStoreServices();
     JwtAuthConfig.Setup(services, Configuration);
 }