Exemplo n.º 1
0
        public async Task <TUser> CreateUser(IRegisterWithNameViewModel login)
        {
            var user = await this.GetUserAsnc(login.Email);

            if (user != null)
            {
                return(null);
            }
            if (!String.IsNullOrWhiteSpace(login.UserName))
            {
                user = await this.GetUserAsnc(login.UserName);

                if (user != null)
                {
                    return(null);
                }
            }
            user          = new TUser();
            user.Email    = login.Email;
            user.UserName = login.UserName;

            var result = await SDHCMemberService.CreateAsync(user, login.Password);

            if (result.Succeeded)
            {
                user = await SDHCMemberService.FindByNameAsync(user.UserName);

                return(user);
            }
            return(null);
        }
Exemplo n.º 2
0
 async Task <IUserBase> ISDHCUserManager.CreateUser(IRegisterWithNameViewModel login)
 {
     return(await this.CreateUser(login));
 }