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

Commented Issue: Error creating multiple entity sets for an entity type in Conventional mb. [534]

$
0
0
In the below example, I am trying to create a 2 entity sets for the Product entity type. One is called Products and other is called DiscardedProducts.

Model
-----
static IEdmModel GetImplicitEdmModel()
{
ODataConventionModelBuilder modelBuilder = new ODataConventionModelBuilder();
var products = modelBuilder.EntitySet<Product>("Products");
var productFamilies = modelBuilder.EntitySet<ProductFamily>("ProductFamilies");
var suppliers = modelBuilder.EntitySet<Supplier>("Suppliers");
var discardedProducts = modelBuilder.EntitySet<Product>("DiscardedProducts");

Exception
---------
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:\Runtime\src\System.Web.Http.OData\OData\Builder\EntitySetConfiguration.cs:line 209
InnerException:

Comments: http://aspnetwebstack.codeplex.com/SourceControl/changeset/15e7a6101b01

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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