/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="Microsoft.Rest.ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (FromProperty != null)
     {
         FromProperty.Validate();
     }
     if (To != null)
     {
         To.Validate();
     }
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (FromProperty == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "FromProperty");
     }
     if (To == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "To");
     }
     if (FromProperty != null)
     {
         FromProperty.Validate();
     }
     if (To != null)
     {
         To.Validate();
     }
 }