예제 #1
0
        public async Task <IdentityResult> RegisterUser(string username, string password, string email, string phoneNumber,
                                                        bool isEmailConfirmed)
        {
            MongoIdentityUser user = new MongoIdentityUser
            {
                UserName       = username,
                Email          = email,
                PhoneNumber    = phoneNumber,
                EmailConfirmed = isEmailConfirmed
            };
            var result = await _userManager.CreateAsync(user, password);

            return(result);
        }
예제 #2
0
        public async Task <IdentityUserDTO> FindUserWithEmail(string email)
        {
            MongoIdentityUser user = await _userManager.FindByEmailAsync(email);

            return(MongoModelToDTOMapper.Map(user));
        }
예제 #3
0
        public async Task <IdentityUserDTO> FindUser(string userName, string password)
        {
            MongoIdentityUser user = await _userManager.FindAsync(userName, password);

            return(MongoModelToDTOMapper.Map(user));
        }
예제 #4
0
        public static IdentityUserDTO Map(MongoIdentityUser source)
        {
            var mapper = config.CreateMapper();

            return(mapper.Map <MongoIdentityUser, IdentityUserDTO>(source));
        }