protected override void UpdateConfiguration(WebRouteConfiguration configuration)
 {
     configuration.AddControllers(typeof(PeopleController));
     configuration.JsonReferenceLoopHandling =
         Newtonsoft.Json.ReferenceLoopHandling.Ignore;
     configuration.MaxTop(2).Expand().Select().OrderBy().Filter();
     configuration.MapODataServiceRoute("odata", "odata", ModelGenerator.GetConventionalEdmModel());
 }
示例#2
0
 protected override void UpdateConfiguration(WebRouteConfiguration configuration)
 {
     configuration.AddControllers(typeof(CustomersController), typeof(OrdersController));
     configuration.JsonReferenceLoopHandling =
         Newtonsoft.Json.ReferenceLoopHandling.Ignore;
     configuration.MaxTop(2).Expand().Filter().OrderBy().SkipToken();
     configuration.MapODataServiceRoute("skiptokentest", "skiptokentest",
                                        SkipTokenEdmModel.GetEdmModel(configuration));
 }
示例#3
0
 protected override void UpdateConfiguration(WebRouteConfiguration configuration)
 {
     configuration.AddControllers(typeof(CustomersController), typeof(OrdersController));
     configuration.JsonReferenceLoopHandling =
         Newtonsoft.Json.ReferenceLoopHandling.Ignore;
     configuration.MaxTop(2).Expand();
     configuration.MapODataServiceRoute("enablequery", "enablequery",
                                        PageAttributeEdmModel.GetEdmModel(configuration));
     configuration.MapODataServiceRoute("modelboundapi", "modelboundapi",
                                        PageAttributeEdmModel.GetEdmModelByModelBoundAPI(configuration));
 }
示例#4
0
 protected override void UpdateConfiguration(WebRouteConfiguration configuration)
 {
     configuration.AddControllers(typeof(CustomersController), typeof(OrdersController));
     configuration.JsonReferenceLoopHandling =
         Newtonsoft.Json.ReferenceLoopHandling.Ignore;
     configuration.MaxTop(10).Expand().Filter().OrderBy().SkipToken();
     configuration.MapODataServiceRoute("customskiptoken", "customskiptoken", builder =>
                                        builder.AddService(ServiceLifetime.Singleton, sp => EdmModel.GetEdmModel(configuration))
                                        .AddService <IEnumerable <IODataRoutingConvention> >(ServiceLifetime.Singleton, sp =>
                                                                                             ODataRoutingConventions.CreateDefaultWithAttributeRouting("customskiptoken", configuration))
                                        .AddService <SkipTokenHandler, SkipTopNextLinkGenerator>(ServiceLifetime.Singleton));
 }