예제 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            ServiceRegisterModule.Register(services, Configuration);

            services.AddMvc()
            .AddJsonOptions(option => option.SerializerSettings.ContractResolver = new DefaultContractResolver());
        }
예제 #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            ServiceRegisterModule.Register(services, Configuration);

            services.AddMvc();
            services.AddOData();

            // Adds a default in-memory implementation of IDistributedCache.
            services.AddDistributedMemoryCache();

            services.AddSession(options =>
            {
                // Set a short timeout for easy testing.
                options.IdleTimeout     = TimeSpan.FromSeconds(10);
                options.Cookie.Name     = ".ODataServer.Demo";
                options.Cookie.HttpOnly = true;
            });
        }