Entity property 'Devices' goes missing from my account entity between the server's JSON response and QuerySucceeded callback
When I check my JSON I can see the array of devices on my returned account object. When I put a breakpoint in my QuerySucceeded method the data.response Account object has no 'Devices' property.
Some extra information:
- I made a many to many relationship in EF Code First by making a collection of Devices on my Account model and a collection of Accounts on my Device model. These are also mapped, etc
- I am expanding devices from the account entity
- Even if I don't do an 'expand' there is still no 'devices' property on the object.
- There is another collection on the Account entity called ReportConfigurations. This entity shows up as a property in the response fine (this is a 1 to many).
- This is my first time modifying the database with CodeFirst. I intially had a database and used a power tool to convert it into Code First. Because of this I could be missing something that is causing it to not be mapped properly but nothing sticks out to me....
Here is the relevant part in AccountMap.cs:
this.HasMany(t => t.Devices)
.WithMany(t => t.Accounts)
.Map(m =>
{
m.ToTable("DeviceAccounts");
m.MapLeftKey("Account_Id");
m.MapRightKey("Device_Id");
});
Relevant parts from Account.cs:
public Account()
{
this.Devices = new List<Device>();
}
public virtual ICollection<Device> Devices { get; set; }
and finally my query:
var query = entityQuery.from('Accounts')
.where('id', 'eq', id)
.expand('devices')
.orderBy('givenName, familyName');

Any ideas for what could be causing this?