예제 #1
0
        public void ConfigureContainer(ServiceRegistry services)
        {
            services.AddCors(options =>
            {
                options.AddPolicy("AllowExpensesMgr",
                                  builder => builder.WithOrigins("http://localhost:49602"));
            });
            services.AddJwtConfiguration(Configuration);

            services.AddSwaggerConfiguration();

            services.AddApplication();

            services.AddInfrastructure(Configuration);

            services.AddControllers();

            // Also exposes Lamar specific registrations
            // and functionality
            services.Scan(s =>
            {
                s.AssembliesAndExecutablesFromApplicationBaseDirectory(a => a.FullName.Contains("Application"));
                s.AssembliesAndExecutablesFromApplicationBaseDirectory(a => a.FullName.Contains("Infrastructure"));
                s.TheCallingAssembly();
                s.WithDefaultConventions();
                s.SingleImplementationsOfInterface();
            });
        }