复杂类型“MyData.AssetReading”通过属性“资产”指的是实体类型“MyData.Asset” [英] The complex type 'MyData.AssetReading' refers to the entity type 'MyData.Asset' through the property 'Asset'

查看:314
本文介绍了复杂类型“MyData.AssetReading”通过属性“资产”指的是实体类型“MyData.Asset”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

综观设置Web API ODATA并试图揭露数据我们EDMX给它。问题是,每一次我一个实体添加到OdataConventionBuilder时候,我得到一个大的讨厌的错误消息负载说:

Looking at setting up Web API odata and trying to expose the data out of our edmx to it. The problem is that every time i add an entity to the OdataConventionBuilder I get a big nasty error message on load saying:

The complex type 'MyData.AssetReading' refers to the entity type 'MyData.Asset' through the property 'Asset'

这似乎在EDMX定义的关系,是从轰炸的WebAPI ODATA有关的复杂类型。如何解决这个问题的EDMX是巨大的,它的一个rejig是pretty多出了问题的任何想法。是否有我需要在Builder.EntitySet或MapOdataRoute方法设置属性?

It seems for relations defined in the edmx is bombing the webapi odata out about a complex type. Any ideas on how to get around this as the edmx is huge and a rejig of it is pretty much out of the question. Is there a property that I need to set on the Builder.EntitySet or the MapOdataRoute method?

推荐答案

此错误消息是由事实,OData的V4当前版本的Web API不支持在模型的复杂类型定义导航属性造成的。即复杂类型不能引用实体类型(S)还没有。

This error message is caused by the fact that the current version of Web API for OData V4 doesn't support defining navigation properties on a complex type in the model. I.e. complex type can't refer to entity type(s) yet.

这工作是由这个问题GitHub的跟踪: https://github.com/OData/WebApi /问题/ 65 。权衡通过注释,如果你想它的优先次序。

This work is tracked by this GitHub issue: https://github.com/OData/WebApi/issues/65. Weigh in by commenting it if you'd like it to be prioritized.

这篇关于复杂类型“MyData.AssetReading”通过属性“资产”指的是实体类型“MyData.Asset”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆