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

FindByIdAsync in UserStore takes 'string' Ids by default (even when inherited from UserStoreInt) #13

Open
karandesai28 opened this issue Oct 25, 2017 · 2 comments

Comments

@karandesai28
Copy link

karandesai28 commented Oct 25, 2017

Here is my UserStoreInt implementation,

public class UserStore : UserStoreInt<DbContext>
    {       
        public UserStore(DbContext context)
            : base(context)
        {
        }
    }

And I am accessing FindByIdAsync method in some repository as:

await _userStore.FindByIdAsync(userId) //datatype of userId is int

On checking the definition of FindByIdAsync here, I found that the parameter of the function has 'string' hardcoded.

I think it should have TKey instead of string because, UserStoreInt also implements this method. I realized that you have called "ConvertIdFromString" inside that method, but that rarely would work in real scenarios because the one using int as type will have to explicitly convert Ids to string and then in your method, it will reconvert to int.

I can make that small change and send a PR. Need your confirmation.

@mrahhal
Copy link
Owner

mrahhal commented Oct 25, 2017

Yes, that seems to be the case. A PR would be appreciated.

@mrahhal
Copy link
Owner

mrahhal commented Oct 25, 2017

It also seems that other methods like GetUserIdAsync return a string. That might also be a mistake.

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

No branches or pull requests

2 participants