Skip to content

Null when FindByNameAsync, it needs NormalizedUserName mapped #25

Description

@EduardRotaru
     CreateMap<MemberModel, AppUser>()
            .ForMember(m => m.NormalizedUserName, opt => {
                opt.MapFrom(c => c.Username.ToUpper());
            });

This is needed because when editing roles:

var user = await _userManager.FindByNameAsync(username); <- its null

This will break since usermanager looks internally for the normalized username. At least for me, but if others encounter user null is because of this problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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