i have a strange behavior in C# with EF It's a .NET Core project with EF Core 1.1.0
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
I've created two Models, "User" and "Group"
public class User
{
public int Id { get; set; }
public string name { get; set; }
public string lastName { get; set; }
public List<Group> Groups { get; set; }
}
public class Group
{
public int Id { get; set; }
public string groupName { get; set; }
public virtual User User { get; set; }
}
The result schould give me a User with a list of his groups.
Now the strange part:
Result comes back from DB, i look into allUser, Groups are Null
I take a look into the context to see the Groups
Groups are filled:
Now i look again into allUser Result and magically the Group is filled inside every User item.
Groups are filled inside User:
I really appreciate any help!!