@@ -161,14 +161,26 @@ public override async Task DeleteAsync([NotNull] TApplication application, Cance
161
161
throw new ArgumentNullException ( nameof ( application ) ) ;
162
162
}
163
163
164
+ // Note: due to a bug in Entity Framework Core's query visitor, the authorizations can't be
165
+ // filtered using authorization.Application.Id.Equals(key). To work around this issue,
166
+ // this local method uses an explicit join before applying the equality check.
167
+ // See https://github.com/openiddict/openiddict-core/issues/499 for more information.
168
+
164
169
Task < List < TAuthorization > > ListAuthorizationsAsync ( )
165
170
=> ( from authorization in Authorizations . Include ( authorization => authorization . Tokens )
166
- where authorization . Application . Id . Equals ( application . Id )
171
+ join element in Applications on authorization . Application . Id equals element . Id
172
+ where element . Id . Equals ( application . Id )
167
173
select authorization ) . ToListAsync ( cancellationToken ) ;
168
174
175
+ // Note: due to a bug in Entity Framework Core's query visitor, the tokens can't be
176
+ // filtered using token.Application.Id.Equals(key). To work around this issue,
177
+ // this local method uses an explicit join before applying the equality check.
178
+ // See https://github.com/openiddict/openiddict-core/issues/499 for more information.
179
+
169
180
Task < List < TToken > > ListTokensAsync ( )
170
181
=> ( from token in Tokens
171
- where token . Application . Id . Equals ( application . Id )
182
+ join element in Applications on token . Application . Id equals element . Id
183
+ where element . Id . Equals ( application . Id )
172
184
select token ) . ToListAsync ( cancellationToken ) ;
173
185
174
186
// Remove all the authorizations associated with the application and
0 commit comments