Exemplo n.º 1
0
 private User(EntityId clientId, Name name, SocialSecurityId cnpj, Email commercialEmail, Version version)
 {
     Id              = clientId;
     Name            = name;
     Cnpj            = cnpj;
     CommercialEmail = commercialEmail;
     Version         = version;
 }
Exemplo n.º 2
0
        public static User From(EntityId clientId, Name name, SocialSecurityId cnpj, Email commercialEmail, Version version)
        {
            var user      = new User(clientId, name, cnpj, commercialEmail, version);
            var validator = new UserValidator();

            user.SetValidationResult(validator.Validate(user));
            return(user);
        }
Exemplo n.º 3
0
        public static SocialSecurityId From(string id)
        {
            var ssId      = new SocialSecurityId(id);
            var validator = new SocialSecurityIdValidator();

            ssId.SetValidationResult(validator.Validate(ssId));

            return(ssId);
        }
Exemplo n.º 4
0
 public static User Empty()
 {
     return(From(EntityId.Empty(), Name.Empty(), SocialSecurityId.Empty(), Email.Empty(), Version.Empty()));
 }