I have the below model. What is the better way to load the parent entity with child entity at the time of fetching from the DB with find method?
Parent Entity:>
You can use Include()
Linq query
using (var context = new DBEntities())
{
var result = (from c in context.Client.Include("Address")
where c.IsActive
select c).ToList();
}
Lambda Expression
using (var context = new DBEntities())
{
var result = context.Client.Include(p => p.Address).Where(c => c.IsActive).ToList();
}