0
_allTemplates = context.Templates
                       .Include(t => t.Fields.OrderBy(f => f.BaseOrder));

and i get this error

The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties.

Can anybody help?

Andrei
  • 42,814
  • 35
  • 154
  • 218
Pnsadeghy
  • 1,279
  • 1
  • 13
  • 20

1 Answers1

1

Include method only specifies the related objects to include in the query results Include Method

If you need ordering of navigation properties it must be done in some other way. e.g. How to order child collections of entities in EF or EF 4.1 code-first: How to order navigation properties when using Include and/or Select methods?

Community
  • 1
  • 1
Vladimir Sachek
  • 1,126
  • 1
  • 7
  • 20