Пример #1
0
 // Responsible for validate business rules
 public bool Validate()
 {
     return(AssertionsConcern.IsSatisfiedBy(AssertionsConcern.HasMinimumLength(string.IsNullOrWhiteSpace(Name) ? "" : Name, 5, Resources.Messages.Person_NameMiniumCharError),
                                            AssertionsConcern.IsStringNotNullOrWhiteSpace(Document, Resources.Messages.Person_DocumentIsEmptyError),
                                            AssertionsConcern.HasLengthEquals(Document, 11, Resources.Messages.Person_DocumentWrognCharCount),
                                            AssertionsConcern.IsGreaterThanOrEquals(PhoneNumbers?.Count(), 1, Resources.Messages.Person_ShouldHaveAtLeastOnePhoneNumber)));
 }