예제 #1
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_2);

            RssReaderNetCore2_2_Services
            .RegisterRssReaderServices(
                services,
                Configuration.GetSection("RSS")
                .Get <IList <string> >());

            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info
                {
                    Version        = "v1",
                    Title          = "News API",
                    Description    = "News Api End point",
                    TermsOfService = "None",
                    Contact        = new Contact
                    {
                        Name  = "Stefan Veselinov",
                        Email = string.Empty,
                        Url   = ""
                    },
                    License = new License
                    {
                        Name = "Use under LICX",
                        Url  = ""
                    }
                });
            });
        }
예제 #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            //RSS READER CONFIG
            RssReaderNetCore2_2_Services.RegisterRssReaderServices(
                services, Configuration
                .GetSection("RSS")
                .Get <IList <string> >());

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