Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public async Task <IdentityUserDTO> FindUserWithEmail(string email)
        {
            MongoIdentityUser user = await _userManager.FindByEmailAsync(email);

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

            return(MongoModelToDTOMapper.Map(user));
        }
Ejemplo n.º 4
0
        public static IdentityUserDTO Map(MongoIdentityUser source)
        {
            var mapper = config.CreateMapper();

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