I have a scenario where I have 3 Entities
class entityA
{
public Guid Id { get; set; }
public string NameA { get; set; }
}
class entityB
{
public Guid Id { get; set; }
public string NameB { get; set; }
public entityA EntityA { get; set; }
}
class entityC
{
public Guid Id { get; set; }
public Guid HistoryId { get; set; }
}
EntityA and entityB have relation but entityC has not relation with any of them.
To get entityA and related entityB data I can do
db.entityA.Include(x=>x.entityB)
but I can't do include() with entityA and entityC because there is no relationship between entityA and entityC.
It is only possible with Linq Query syntax like bellow:
from A in entityA join C in entityC on A.Id equals C.HistoryId select A
Is there is any way to include() or join entityA and entityC using Linq Lambda syntax ?