示例#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();
            ServiceFactory factory = new ServiceFactory(services);

            factory.AddCustomServices();
            factory.AddDbContextService(this.Configuration.GetConnectionString("Obl1DB"));
        }
示例#2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers(options => options.Filters.Add(typeof(ExceptionFilter)));
            ServiceFactory serviceFactory = new ServiceFactory(services);

            serviceFactory.AddDbContextService();
            serviceFactory.AddCustomServices();
            services.AddScoped <AuthorizationDIFilter>();
        }
示例#3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            AddSwagger(services);
            ServiceFactory factory = new ServiceFactory(services);

            factory.AddCustomServices();
            factory.AddDbContextService();
            services.AddScoped <AuthorizationAttributeFilter>();
            services.EnableAllCors();
        }