Пример #1
0
 public void Save(Person person)
 {
     if (_validator.IsValid(person))
     {
         _dataCotext.Save(person);
     }
     else
     {
         throw new ArgumentException("Person is not valid");
     }
 }
Пример #2
0
        public bool CanPurchase(Person p)
        {
            if (!(validator.IsValid(p)))
            {
                return(false);
            }

            if (p.SSID != null &&
                p.SubscriptionType != null &&
                p.CreditOnFile > 0)
            {
                return(true);
            }

            return(false);
        }