protected override void UpdateConfiguration(WebRouteConfiguration configuration)
        {
            var controllers = new[] { typeof(DCustomersController), typeof(MetadataController), typeof(EfCustomersController) };

            configuration.AddControllers(controllers);

            TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); // -8:00

            configuration.SetTimeZoneInfo(timeZoneInfo);

            configuration.Routes.Clear();
            configuration.Count().Filter().OrderBy().Expand().MaxTop(null);
            configuration.MapODataServiceRoute(
                routeName: "convention",
                routePrefix: "convention",
                model: DateAndTimeOfDayEdmModel.GetConventionModel(configuration));

            configuration.MapODataServiceRoute(
                routeName: "explicit",
                routePrefix: "explicit",
                model: DateAndTimeOfDayEdmModel.GetExplicitModel(),
                batchHandler: configuration.CreateDefaultODataBatchHandler());

            configuration.EnsureInitialized();
        }
示例#2
0
 protected override void UpdateConfiguration(WebRouteConfiguration configuration)
 {
     configuration.AddControllers(typeof(CustomersController), typeof(OrdersController), typeof(DatesController), typeof(DateOffsetsController));
     configuration.JsonReferenceLoopHandling =
         Newtonsoft.Json.ReferenceLoopHandling.Ignore;
     configuration.MaxTop(2).Expand().Filter().OrderBy().SkipToken();
     configuration.MapODataServiceRoute("skiptokentest", "skiptokentest",
                                        SkipTokenEdmModel.GetEdmModel(configuration));
     configuration.SetTimeZoneInfo(TimeZoneInfo.Utc);
 }