I'm getting started with OData and Entity Framework.
I created a Controller that exposes Customer. In the model (edmx) there's only one Entity (Customer) and everything works fine (data is being rendered).
Now, when I add a second entity (Order) (Update model from database, select Order), the 1 to many (1 Customer to Many Order) gets setup automatically.
I do nothing else and when I compile/run the controller, I get this error:
Line 23: builder.EntitySet(Of Customer)("Customers")
Line 24: Return builder.GetEdmModel() --> Exception Here
Line 25:
Line 26: End Function
The complex type 'WebTools.Order' refers to the entity type 'WebTools.Customer' through the property 'Customer'.
If I remove the Order Entity, it works.
I'm not sure if the problem is with the "configuration" of the OData/WebAPI part of the equation or the "Entity Framework".