Ejemplo n.º 1
0
 private Member(string firstName, string lastName, Address address, MembershipLevelEnum membershipLevelEnum, MembershipLevel membershipLevel)
 {
     FirstName         = firstName;
     LastName          = lastName;
     Address           = address;
     RegistrationDate  = DateTime.Now;
     MembershipLevelId = membershipLevelEnum;
     MembershipLevel   = membershipLevel;
 }
Ejemplo n.º 2
0
        public static Member CreateMember(string firstName, string lastName, Address address, MembershipLevelEnum membershipLevelEnum, MembershipLevel membershipLevel)
        {
            if (string.IsNullOrWhiteSpace(firstName) || string.IsNullOrWhiteSpace(lastName) || address == null || membershipLevel == null)
            {
                return(null);
            }

            return(new Member(firstName, lastName, address, membershipLevelEnum, membershipLevel));
        }
Ejemplo n.º 3
0
        public static Member CreateMember(string firstName, string lastName, Address address, MembershipLevelEnum membershipLevelEnum, MembershipLevel membershipLevel)
        {
            //Throw validation exception, not return null, make it explicit that the consumer has made an error
            if (string.IsNullOrWhiteSpace(firstName) || string.IsNullOrWhiteSpace(lastName) || address == null || membershipLevel == null)
            {
                return(null);
            }

            return(new Member(firstName, lastName, address, membershipLevelEnum, membershipLevel));
        }