Exemple #1
0
        public void RegisterEndpoint(IEndpointRouteBuilder routeBuilder)
        {
            var apiConfig = routeBuilder.ServiceProvider.GetRequiredService <ApiConfig>();

            if (apiConfig.Enabled)
            {
                //OData
                var       serviceProvider = routeBuilder.ServiceProvider;
                IEdmModel model           = GetEdmModel(serviceProvider, apiConfig);
                routeBuilder.Count().Filter().OrderBy().MaxTop(Configurations.MaxLimit);
                routeBuilder.MapODataRoute(Configurations.ODataRouteName, Configurations.ODataRoutePrefix, model);
                routeBuilder.EnableDependencyInjection();
            }
        }