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
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