This is against the nightly builds of Web API OData, etc...
I've got an Account class, mapped using Entity Framework code first. In EF, Account has a Many to Many relationship to Role. Modeled as an ICollection<Role> property on the Account class.
When I try to retrieve Accounts through Web API OData, I get a 400 Bad Request. If I remove the Roles property, I can retrieve Accounts through Web API OData.
Relevant Entity Classes:
```
public abstract class Entity
{
public Guid Id {get;set;}
}
public class Account : Entity
{
public virtual ICollection<Role> Roles {get;set;}
}
public class Role : Entity
{
public virtual string Name {get;set;}
}
```
Relevant OData Configuration:
```
public static IEdmModel GenerateEdmModel()
{
var builder = new ODataConventionModelBuilder();
var accounts = builder.EntitySet<Account>("Accounts").EntityType;
accounts.HasMany(a => a.Roles);
return builder.GetEdmModel();
}
```
Comments: @jonstelly: there is an issue open already for that - [add model validation pass in odata model builder](http://aspnetwebstack.codeplex.com/workitem/437)