|
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&tid=1354472]: |
0ms |
get settings: |
28ms |
get forum list: |
10ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
100ms |
get topic data: |
77ms |
get forum data: |
5ms |
get page messages: |
253ms |
get tp. blocked users: |
2ms |
others: | 184ms |
total: | 671ms |
0 / 0 |