BinaryStudio.TaskManager.Logic.Core.UserProcessor.CreateUser C# (CSharp) Метод

CreateUser() публичный Метод

The create user.
public CreateUser ( string userName, string password, string email, string linkedInId, byte imageData, string imageMimeType ) : bool
userName string /// The user name. ///
password string /// The password. ///
email string /// The email. ///
linkedInId string /// The linked in id. ///
imageData byte /// The image data. ///
imageMimeType string /// The image mime type. ///
Результат bool
        public bool CreateUser(string userName, string password, string email, string linkedInId, byte[] imageData, string imageMimeType)
        {
            var user = this.userRepository.GetByName(userName);
            if (user != null)
            {
                return false;
            }
            
            var salt = this.cryptoProvider.CreateSalt();
            var newUser = new User
            {
                UserName = userName,
                RoleId = 2,
                Credentials = new Credentials
                                  {
                                      Passwordhash = this.cryptoProvider.CreateCryptoPassword(password, salt),
                                      Salt = salt,
                                      IsVerify = true
                                  },
                Email = email,
                LinkedInId = linkedInId,
                ImageData = imageData,
                ImageMimeType = imageMimeType
            };

            this.userRepository.CreateUser(newUser);
            return true;
        }