I have the following models:
class Item
{
public ICollection<string> GroupIds { get; set; }
// Introduced for EF only
public ICollection<Group> Groups { get; set; }
}
class Group
{
public ICollection<string> ItemIds { get; set; }
// Introduced for EF only
public ICollection<Item> Items { get; set; }
}
class Store
{
public ICollection<Item> Items { get; set; }
public ICollection<Group> Groups { get; set; }
}
Store contains all Items
and all Groups
, but every Item
may be related with one or multiple Group
and every Group
may be related with one or multiple Item
.
How I can configure many-to-many relationship between Item
and Group
to load only GroupIds
and ItemIds
, but not objects itself?