I work with ASP.NET MVC with Durandal / Breeze templates.
Let's say I have the following class:
public class Person { public int Id { get; set; } public string Firstname { get; set; } public string Lastname { get; set; } public virtual List<Person> Friends { get; set; } }
With the following EF Fluent API:
modelBuilder.Entity<Person>() .HasMany(m => m.Friends) .WithMany() .Map(m => m.ToTable("Friends"));
The database was generated successfully.
The problem is that I am doing que
ry with Breeze (client side) I have no data for the Friends property.
var query = entityQuery.from('Person') .where('id', '==', 123) .expand("Friends");
When the request is executed, I get the requested People object with all the data except the Friends property, which is always an empty array. When I check the Json response, I see that the data is also being transmitted. Even the data for the Friends property. However, they are not affiliated with the Friends property.
My question is: what do I need to do so that my friends property is populated with values?
Thanks.
source share