Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserManager.Users throws System.NotSupported #25

Open
Mech0z opened this issue Dec 11, 2016 · 5 comments
Open

UserManager.Users throws System.NotSupported #25

Mech0z opened this issue Dec 11, 2016 · 5 comments
Labels

Comments

@Mech0z
Copy link

Mech0z commented Dec 11, 2016

Hi, I am trying to use the Users to get all registered users, maybe I am using the framework wrong, but my idea is

I have https://github.com/Mech0z/FoosballCore2 which is a foosball site, I then want a setup page that can be run there if there is no user with Administrator claim.

Is there a way to get all users and check how many have a certain role? Or should I just make my own repository that gets all users and make a count myself.

@tugberkugurlu
Copy link
Owner

@Mech0z thanks for reporting this. this is currently by design but doesn't have to be that way. AFAIK, MongoDB .NET Driver supports queryable. So, MongoUserStore<TUser> could implement IQueryableUserStore<TUser> and expose _usersCollection.AsQueryable() through Users property.

I am not entirely sure though which LINQ operations MongoDB supports. We may need to write tests.

@Mech0z do you want to help me out on getting this implemented?

@tugberkugurlu
Copy link
Owner

As a workaround, you can query MongoDB by yourself through your own way.

@tugberkugurlu
Copy link
Owner

@Mech0z ⬆️ any thoughts?

@Mech0z
Copy link
Author

Mech0z commented Feb 16, 2017

Sorry I havent had time to look at it, But since you fixed https://github.com/tugberkugurlu/AspNetCore.Identity.MongoDB/releases/tag/1.0.0-rc3 I have just made a derived User repo that can fetch both single and all users.

If I get time I can try to look at making a pull request if I can make an implementation of it into your framework

@dealproc
Copy link
Collaborator

If someone wants to tell me what test(s) may need to be written... the property takes ~30 seconds to add... so it's just adding tests to proof what we can/cannot do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants