// 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_1);
     //Paging.ConfigureServices(services);
     SwaggerConfig.ConfigureServices(services);
     AppIDConfigUrl.ConfigureServices(services);
     //IMapperConfig.ImapperConfigService(services);
     //ConfigServiceFluentValidation.ConfigureServices(services);
     services.AddDbContext <ChoThueXeContext>(options =>
                                              options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
     RepositoryConfig.ConfigureServices(services);
 }
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)
        {
            CORSConfig.ConfigureServices(services);
            services.AddMvcCore()
            .AddAuthorization()
            .AddJsonFormatters();

            services.AddAuthentication("Bearer")
            .AddIdentityServerAuthentication(options =>
            {
                options.Authority            = endponit + tenantId;
                options.RequireHttpsMetadata = false;
            });
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            Paging.ConfigureServices(services);
            SwaggerConfig.ConfigureServices(services);
            AppIDConfigUrl.ConfigureServices(services);

            services.AddDbContext <ChoThueXeContext>(options =>
                                                     options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
            RepositoryConfig.ConfigureServices(services);
        }