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