示例#1
0
 public void ConfigureServices(IServiceCollection services)
 {
     SimpleInjectorConfiguration.ConfigureServices(services, _configuration);
     CorsConfiguration.ConfigureServices(services);
     MvcConfiguration.ConfigureServices(services);
     SwaggerConfiguration.ConfigureServices(services);
     HangfireConfiguration.ConfigureServices(services, _configuration);
     DatabaseConfiguration.ConfigureServices(services, _configuration);
 }
示例#2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Interface mapping
            InterfaceConfiguration.ConfigureServices(services);

            // Database
            DatabaseConfiguration.ConfigureServices(services, Configuration);


            services.AddRazorPages()
            .AddRazorRuntimeCompilation();

            services.AddLiveReload();
        }
示例#3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Api Rest Configuration
            RestServiceConfiguration.ConfigureServices(services);

            // Database configuration
            DatabaseConfiguration.ConfigureServices(services, Configuration);

            // Identity service configuration
            IdentityServiceConfiguration.ConfigureServices(services, Configuration);

            // Authorization
            AppAuthorizationConfiguration.ConfigureAuthorization(services);

            // Authentication configuration
            AuthenticationConfiguration.ConfigureServices(services, Configuration);

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "DavidMorales.WebHost", Version = "v1"
                });
            });



            // Identity
            services.AddTransient <AppIdentity>();
            services.TryAddSingleton <IHttpContextAccessor, HttpContextAccessor>();

            // Log
            services.AddLogging();

            // Cors
            services.AddCors();
        }