I have some simple classes that looks like this:
Class Favorites
Guid UserId
Guid ObjectId
Class Objects
Guid Id
String Name
With Entity Framework I want to select all the Objects which has been marked as a favorite by a user.
So I tried something like this
context.Objects.Where(
x => x.Id ==
context.Favorite.Where(f => f.UserId == UserId)
.Select(f => f.ObjectId).Any()
);
But I don’t get it. I also tried with intersect, but what I understand it most be the same type. One User can have many Favorite objects
you could use join clause: