diogodamiani / IdentityServer4.Contrib.MongoDB

MongoDB persistence layer for IdentityServer4
Apache License 2.0
111 stars 58 forks source link

Issue #34 Fixes NotSupportedException when loading ApiScopes by name #35

Closed tbureck closed 4 years ago

tbureck commented 4 years ago

ResourceStore.FindApiScopesByNameAsync would throw a NotSupportedException, because a Select(x => x.ToModel()) is executed on MongoDB's IQueryable implementation, while ToModel is not a queryable part of the given Entity, but an external extension method.

This fix changes this behaviour by collecting the query result into an array and then performing the Select just like the other query methods do with their queries.