Skip to content

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

@karandesai28

Description

@karandesai28

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions