Exemplo n.º 1
0
        protected override void UpdateConfiguration(WebRouteConfiguration configuration)
        {
            var controllers = new[] { typeof(ItemsController) };

            configuration.AddControllers(controllers);
            configuration.IncludeErrorDetail = true;

            configuration.Routes.Clear();
            configuration.Count().Filter().OrderBy().Expand().MaxTop(null);

            configuration.MapODataServiceRoute(
                routeName: "odata",
                routePrefix: "odata",
                model: OrderByEdmModel.GetModel(configuration));

            configuration.EnsureInitialized();
        }
Exemplo n.º 2
0
        protected override void UpdateConfiguration(HttpConfiguration configuration)
        {
            var controllers = new[] { typeof(ItemsController) };
            TestAssemblyResolver resolver = new TestAssemblyResolver(new TypesInjectionAssembly(controllers));

            configuration.Services.Replace(typeof(IAssembliesResolver), resolver);

            configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

            configuration.Routes.Clear();
            configuration.Count().Filter().OrderBy().Expand().MaxTop(null);

            configuration.MapODataServiceRoute(
                routeName: "odata",
                routePrefix: "odata",
                model: OrderByEdmModel.GetModel());

            configuration.EnsureInitialized();
        }