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);
        }
Example #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));
        }
Example #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
                });
            }
                                                                   ));
        }
Example #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
                });
            }
                                                                             ));
        }