You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Properties linked to related tables via foreign key don't seem to be populated
I have
var query =
from u in dbContext.Users
where u.Id == userId
select u.IsMaster || (
from ur in u.UserRoles
where
ur.Role.Name == "Developer"
select
1
).Any();
Tried your provided solution - fails in EF Core 5, EF Core 6 and as well as in EF Core 7.
For as long as I am using this project, I don't remember it supporting auto mapping navigational properties. At least we always had that issue.
As well as updating property via navigation won't be reflected by a change in a table (for example, updating role name via user.Role.Name = "foo" (imagine it's a one-to-one relation for simplicity), you won't see that new name in Roles table).
At least these are two mains things that we always had, but came around them by setting those properties ourselves.
Properties linked to related tables via foreign key don't seem to be populated
I have
See (https://github.com/mlockett42/EntityFrameworkCoreMock.Fail/blob/master/EntityFrameworkCoreMock.Fail/DemonstrateEFCore7Error.cs#L72)
Which evaluate to false in spite of the face that user with Id == userId is linked to a UserRole which is linked to a Role named "Developer"
I have created this small project to demonstrate this error https://github.com/mlockett42/EntityFrameworkCoreMock.Fail
This works for us in EFCore 6 and 5 and the same version of EntityFrameworkCoreMock.Moq
The text was updated successfully, but these errors were encountered: