/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="Rest.ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Submitted != null)
     {
         Submitted.Validate();
     }
     if (Approved != null)
     {
         Approved.Validate();
     }
     if (Accepted != null)
     {
         Accepted.Validate();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Capabilities != null)
     {
         if (Capabilities.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(Capabilities)))
         {
             throw new ValidationException(ValidationRules.UniqueItems, "Capabilities");
         }
     }
     if (DiscoveryUrls != null)
     {
         if (DiscoveryUrls.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(DiscoveryUrls)))
         {
             throw new ValidationException(ValidationRules.UniqueItems, "DiscoveryUrls");
         }
     }
     if (HostAddresses != null)
     {
         if (HostAddresses.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(HostAddresses)))
         {
             throw new ValidationException(ValidationRules.UniqueItems, "HostAddresses");
         }
     }
     if (Created != null)
     {
         Created.Validate();
     }
     if (Approved != null)
     {
         Approved.Validate();
     }
     if (Updated != null)
     {
         Updated.Validate();
     }
 }