User1699480839 posted
Hello everyone;
EFCore has some confusions with my schema and I con not figure out how to solve.
WebSiteModel has two property;
public virtual ICollection<IconLinkModel> NavBarUpperLeftItems { get; set; }
public virtual ICollection<IconLinkModel> NavBarItems { get; set; }
Normally, I should have 4 items in NavBarUpperLeftItems and 1 item in NavBarItems.
When I fetch data like that;
website = context
.WebSites
.Include(x => x.NavBarUpperLeftItems)
.Include(x => x.NavBarItems)
.FirstOrDefault(x => x.Domain == domain);
NavBarUpperLeftItems is empty and all items comes in NavBarItems.
Is that a normal behaviour, how can I avoid that?
PS: I am using MySQL, Pomelo driver and dotnetcore 5.
Thanks.