0

I am trying to write a query using eSQL wherein my entity has got navigation properties. I am not able to include these navigation properties in the query, even though in Linq to SQL we have this (Include method).

How will it be possible in eSQL?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
bbbbb
  • 29
  • 2
  • 5

1 Answers1

0

Like so:

string esql = "Select value e from EFEntities.MyDataEntity as e";

ObjectQuery<Data.MyDataEntity> query = c.
    CreateQuery<Data.MyDataEntity>(esql).
    Include("MyNavigationProperty");

List<Data.MyDataEntity> entities = query.ToList();
Sprintstar
  • 7,938
  • 5
  • 38
  • 51