Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            SwaggerInitializer.Configure(services);

            SetupCommanderDatabase(services);

            services.AddControllers().AddNewtonsoftJson(serializer => serializer.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver());

            AutoMapperInitializer.Configure(services);

            RepositoryInitializer.Configure(services);

            BusinessServiceInitializer.Configure(services);

            DALInitializer.Configure(services);
        }
Пример #2
0
        // 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);

            // Auto Mapper Configurations
            var mappingConfig = new MapperConfiguration(mc =>
            {
                mc.AddProfile(new AutoMapperProfile());
            });

            IMapper mapper = mappingConfig.CreateMapper();

            services.AddSingleton(mapper);

            services.Configure <FileSettingManager>(this.Configuration.GetSection("FileSettingManager"));
            BusinessInitializer.Initialize(services);

            var dbProviderType = this.Configuration["Database:ProviderType"];

            DALInitializer.Initialize(services, dbProviderType);
        }