我试图将V3转换为V4.但是,转换显示删除了对http://aspnetwebstack.codeplex.com/workitem/1753中的 System.DateTime的支持.我无法更改模型以使用偏移量.还有其他问题,但没有提供解决方法.
我决定做这样的事情:
var builder = new ODataConventionModelBuilder();
var config = builder.EntitySet<DepartmentListItem>("DepartmentList");
config.EntityType.Ignore(x => x.StartDate);
var ops = new ODataQueryOptions<DepartmentListItem>(new ODataQueryContext(builder.GetEdmModel(), typeof(DepartmentListItem), null), queryOptions.Request);
var query = ops.ApplyTo(_uow.Set<DepartmentListItem>()).Cast<DepartmentListItem>();
Run Code Online (Sandbox Code Playgroud)
只是为了让它工作但无济于事.无论如何都要手动处理此转换.
谢谢.