Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Multiple entity sets with same type is not supported for navigation property in derived type [553]

$
0
0
Repro code attached.
Send request: GET http://localhost:50232/vehicles to repro the issue.

The exception is:
System.NotSupportedException occurred
HResult=-2146233067
Message=Cannot autoCreate binding because there are two or more candidate EntitySets.
Source=System.Web.Http.OData
StackTrace:
at System.Web.Http.OData.Builder.EntitySetConfiguration.FindBinding(NavigationPropertyConfiguration navigationConfiguration, Boolean autoCreate) in d:\git\WebStackRuntime\src\System.Web.Http.OData\OData\Builder\EntitySetConfiguration.cs:line 207
InnerException:

If user explicitly sets binding to specified entity set, we shouldn't throw for multiple entity sets found. The problem is when adding navigation properties from derived types to base type, we use it's declared type to determine which entity set to bind, instead of the bindings user set in derived type.
Comments: test defect. the error message is unclear in this case though which was fixed as a part of fix to issue 534. the new error message explains the underlying test issue, "Cannot automatically bind the navigation property 'Vehicle' on entity type 'ODataRepro.Car' for the source entity set 'vehicles' because there are two or more matching target entity sets. The matching entity sets are vehicles, anotherVehicles."

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>