【发布时间】:2016-03-30 20:53:21
【问题描述】:
尝试使用 Entity Framework 6.1 围绕典型的默认 Northwind 数据库构建 WebAPI 2 / OData v4 服务 我的 WebApiConfig 对“复杂的类型关系”不满意:
An exception of type 'System.InvalidOperationException'
occurred in System.Web.OData.dll
but was not handled in user code
Additional information: The complex type 'ODataProductService.Models.Order_Detail'
refers to the entity type 'ODataProductService.Models.Product'
through the property 'Product'.
显然,在任何给定的数据库中,这些关系都极有可能发生。 处理这个问题的正确方法是什么?
【问题讨论】:
标签: asp.net-web-api odata asp.net-web-api2