Exemplo n.º 1
0
        public void ConfigureServices(IServiceCollection services)
        {
            ServiceExtensions.ConfigureCors(services);
            ServiceExtensions.AddScoped(services);

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            services.AddDbContext <PlanetDatabaseContext>(options
                                                          => options.UseSqlServer(Configuration["ConnectionStrings:PlanetDatabaseConnection"]));
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            ServiceExtensions.ConfigureServices(services);
            ServiceExtensions.ConfigureCors(services);

            services.AddMvcCore().SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
            .AddApiExplorer();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Music World WebAPI", Description = "Music World API details", Version = "v1"
                });
            });
        }