Given entities like these:
public class Entity
{
public int Id { get; set; }
public ICollection<EntityTwo> EntityTwos { get; set; }
}
public class EntityTwo
{
public int Id { get; set; }
public int TypeId { get; set; }
public int EntityId { get; set; }
}
Normally, Entity.EntityTwos
would return all EntityTwo entities where EntityId
equals Entity.Id
. Is it possible to rig up the model so that property returns entities that join on that Id, but also have EntityTwo.TypeId == 2
(essentially adding a where clause to the join)?