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

自闭症网瘾萝莉.ら 提交于 2019-12-10 00:10:47

问题


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'

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?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/28871565/the-complex-type-mydata-assetreading-refers-to-the-entity-type-mydata-asset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!