internal static Result <User> Create(CreateUserDto dto, INormalizer normalizer, IPasswordService passwordService) { User user = null; return(UserFullname.Create(dto.Firstname, dto.Lastname) .Tap(n => user = new User(n)) .Bind(_ => user.UpdateEmail(dto.Email, normalizer)) .Bind(() => user.SetPassword(dto.Password, passwordService)) .Map(() => user)); }
public static UserFullname Parse(SqlString s) { if (s.IsNull) { return(Null); } UserFullname text = new UserFullname(); string str = s.ToString(); text._text = str; return(text); }
private User(UserFullname name) { Id = Guid.NewGuid().ToString(); Name = name; }