Esempio n. 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

            app.UseAuthentication();
            // add OData authorization middleware
            // we don't need to UseAuthorization() if we don't need to handle authorizaiton for non-odata routes
            app.UseODataAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.Expand().Filter().Count().OrderBy();
                endpoints.MapODataRoute("odata", "odata", AppModel.GetEdmModel());
            });
        }