|
EF include all relative entities
|
|||
---|---|---|---|
#18+
Коллеги, а разве вот этот код не идентичен? Код: c# 1. 2. 3. 4. 5.
Код: c# 1. 2. 3. 4.
Второй падает с ошибкой System.InvalidOperationException: 'The expression 'x.UserRoles.AsQueryable().Select(r => r.Role)' is invalid inside an 'Include' operation, since it does not represent a property access: 't => t.MyProperty'. To target navigations declared on derived types, use casting ('t => ((Derived)t).MyProperty') or the 'as' operator ('t => (t as Derived).MyProperty'). Collection navigation access can be filtered by composing Where, OrderBy(Descending), ThenBy(Descending), Skip or Take operations. For more information on including related data, see http://go.microsoft.com/fwlink/?LinkID=746393.' вроде как должно было воркать Код: c# 1. 2. 3. 4.
https://docs.microsoft.com/ru-ru/ef/ef6/querying/related-data ... |
|||
:
Нравится:
Не нравится:
|
|||
06.12.2021, 16:02 |
|
|
Start [/forum/topic.php?fid=18&fpage=1&tid=1354472]: |
0ms |
get settings: |
17ms |
get forum list: |
7ms |
check forum access: |
1ms |
check topic access: |
1ms |
track hit: |
48ms |
get topic data: |
6ms |
get forum data: |
1ms |
get page messages: |
63ms |
get tp. blocked users: |
2ms |
others: | 302ms |
total: | 448ms |
0 / 0 |