// This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvcCore(options =>
            {
                options.InputFormatters.Insert(0, new JilInputFormatter());
                options.OutputFormatters.Insert(0, new JilOutputFormatter());
            })
            .AddControllersAsServices()
            .AddJsonFormatters()
            .AddApiExplorer();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info
                {
                    Version     = "v1",
                    Title       = "Location API",
                    Description = "API to search for addresses by zip or name"
                });
            });

            var container = InjectionDependency.ConfigureService();

            MapperDomain.Configure();

            return(container.CreateServiceProvider(services));
        }
示例#2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvcCore().AddControllersAsServices().AddJsonFormatters();

            var container = InjectionDependency.ConfigureService();

            return(container.CreateServiceProvider(services));
        }