Ejemplo n.º 1
0
        public CreatedUserDTO Create(
            string name,
            UserProfile profile,
            string email,
            string password
            )
        {
            var cryptPassword = _crypt.CreateMD5(password);

            var user           = new User(name, cryptPassword, email, profile);
            var userValidation = user.Validate();

            if (userValidation.isValid)
            {
                _usersRepository.Add(user);
                return(new CreatedUserDTO(user.Id));
            }

            return(new CreatedUserDTO(userValidation.errors));
        }