public override bool IsValid(Notification notification)
 {
     try
     {
         var uri = new Uri(_url);
     }
     catch (Exception ex)
     {
         notification.AddError(new ValidationError(ex.Message));
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 public bool IsValid(Notification notification)
 {
     try
     {
         var constructor = GetType().GetConstructor(ConstructorArguments.Select(x => x.GetType()).ToArray());
         if (constructor == null)
         {
             notification.AddError(new ValidationError(string.Format("Failed to extract constructor for operation {0}. Check the order of the parameters going into the base class. The order needs to be the same is in your constructor", GetType().Name)));
             return false;
         }
     }
     catch(Exception ex)
     {
         notification.AddError(new ValidationError(string.Format("Failed to extract constructor for operation {0}. Error message: {1}", GetType().Name, ex.Message)));
         return false;
     }
     return true;
 }