Esempio n. 1
0
        private static Customer Create(Guid id, string name, string email)
        {
            var customer = new Customer();

            if (string.IsNullOrEmpty(name))
            {
                customer.AddValidation("Name can't be empty");
            }

            if (string.IsNullOrEmpty(email))
            {
                customer.AddValidation("Email can't be empty");
            }

            customer.Id    = id;
            customer.Name  = name;
            customer.Email = email;

            return(customer);
        }