protected static void UpdateConfigureServices(IServiceCollection services)
        {
            IEdmModel model = UriParserExtenstionEdmModel.GetEdmModel();

            services.ConfigureControllers(typeof(CustomersController), typeof(OrdersController), typeof(MetadataController));

            services.AddControllers().AddOData(opt => opt.AddModel("odata", model).RouteOptions.EnableUnqualifiedOperationCall = false);
        }
예제 #2
0
        protected static void UpdateConfigureServices(IServiceCollection services)
        {
            services.ConfigureControllers(typeof(CustomersController), typeof(OrdersController), typeof(MetadataController));

            IEdmModel model = UriParserExtenstionEdmModel.GetEdmModel();

            services.AddOData(opt => opt.AddModel("odata", model));
        }
        protected static void UpdateConfigureServices(IServiceCollection services)
        {
            services.ConfigureControllers(typeof(CustomersController), typeof(OrdersController), typeof(MetadataController));

            IEdmModel model = UriParserExtenstionEdmModel.GetEdmModel();

            services.AddOData(opt => opt.AddModel("odata", model).Count().Filter().OrderBy().Expand().SetMaxTop(null));
        }
예제 #4
0
        protected static void UpdateConfigureServices(IServiceCollection services)
        {
            services.ConfigureControllers(typeof(CustomersController), typeof(OrdersController), typeof(MetadataController));

            IEdmModel model = UriParserExtenstionEdmModel.GetEdmModel();

            services.AddControllers().AddOData(opt => opt.AddModel("odata", model,
                                                                   builder =>
            {
                builder.AddService(Microsoft.OData.ServiceLifetime.Singleton, typeof(ODataUriResolver), sp => new StringAsEnumResolver()
                {
                    EnableCaseInsensitive = true
                });
            }
                                                                   ));
        }
예제 #5
0
        protected static void UpdateConfigureServices(IServiceCollection services)
        {
            services.ConfigureControllers(typeof(CustomersController), typeof(OrdersController), typeof(MetadataController));

            IEdmModel model = UriParserExtenstionEdmModel.GetEdmModel();

            services.AddControllers().AddOData(opt => opt.AddRouteComponents("odata", model,
                                                                             services =>
            {
                services.AddSingleton <ODataUriResolver>(sp => new StringAsEnumResolver()
                {
                    EnableCaseInsensitive = true
                });
            }
                                                                             ));
        }