Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            // [SystemConfigs]
            SystemConfigs.Service(services);

            // [Cros] Policy
            Cros.Service(services);

            // [Document API] Swagger
            Swagger.Service(services);

            // [Background Job] Hangfire
            Hangfire.Service(services);

            // [Caching] Redis Cache
            services.AddRedisCache();

            // [Mini Response] WebMarkup
            WebMarkupMin.Service(services);

            // [Mapper] Auto Mapper
            services.AddAutoMapper();

            // [MVC]
            Mvc.Service(services);

            // [Injection] Keep In Last
            DependencyInjection.Service(services);

            // [Database] Use Entity Framework
            Database.Service(services);
        }
Beispiel #2
0
        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            // [Important] The order of middleware very important for request and response handle!
            // Don't mad it !!!

            // [SystemConfigs]
            SystemConfigs.Middleware(app, loggerFactory);

            // Migrate Database
            app.DatabaseMigrate();

            // [Response] Information
            ProcessingTimeMiddleware.Middleware(app);
            SystemInfoMiddleware.Middleware(app);

            // [Cros] Policy
            Cros.Middleware(app);

            // [Log] Serilog
            Log.Middleware(app, loggerFactory);

            // [Exception]
            Exception.Middleware(app);

            // [Security] Identity Server
            IdentityServer.Middleware(app);

            // [Document API] Swagger
            Swagger.Middleware(app);

            // [Background Job] Hangfire
            Hangfire.Middleware(app);

            // [Mini Response] WebMarkup
            WebMarkupMin.Middleware(app);

            // [MVC] Keep In Last
            Mvc.Middleware(app);
        }