Пример #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Members == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Members");
     }
     if (ResponseMetadata == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ResponseMetadata");
     }
     if (Members != null)
     {
         if (Members.Count < 1)
         {
             throw new ValidationException(ValidationRules.MinItems, "Members", 1);
         }
         if (Members.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(Members)))
         {
             throw new ValidationException(ValidationRules.UniqueItems, "Members");
         }
     }
     if (ResponseMetadata != null)
     {
         ResponseMetadata.Validate();
     }
 }
Пример #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Channel == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Channel");
     }
     if (ResponseMetadata != null)
     {
         ResponseMetadata.Validate();
     }
 }
Пример #3
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Channels == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Channels");
     }
     if (Channels != null)
     {
         if (Channels.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(Channels)))
         {
             throw new ValidationException(ValidationRules.UniqueItems, "Channels");
         }
     }
     if (ResponseMetadata != null)
     {
         ResponseMetadata.Validate();
     }
 }