Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var apiSettings = new APISettingsConfiguration();

            Configuration.GetSection("APISettings").Bind(apiSettings);
            services.AddSingleton(apiSettings);

            services.AddScoped <ICountryAppService, CountryAppService>();
            services.AddScoped <IAnimalAppService, AnimalAppService>();
            services.AddScoped <IRedList, RedList>();

            var mapperConfig = new MapperConfiguration(mc =>
            {
                mc.AddProfile(new Mapping());
            });
            IMapper mapper = mapperConfig.CreateMapper();

            services.AddSingleton(mapper);

            services.AddControllersWithViews();
        }
Exemplo n.º 2
0
 public RedList(APISettingsConfiguration apiSettingsConfiguration)
 {
     this.apiSettingsConfiguration = apiSettingsConfiguration;
 }