Exemple #1
0
 public static bool CreatedFrom <T>([NotNull] this DynamicException ex, StringComparison comparisonType = StringComparison.Ordinal) where T : IDynamicExceptionTemplate
 {
     if (ex == null)
     {
         throw new ArgumentNullException(nameof(ex));
     }
     return(ex.NameEquals(Regex.Replace(typeof(T).Name, "Template$", string.Empty), comparisonType));
 }
Exemple #2
0
 public static bool NameEquals([NotNull] this DynamicException ex, Enum errorCode, StringComparison comparisonType = StringComparison.Ordinal)
 {
     if (ex == null)
     {
         throw new ArgumentNullException(nameof(ex));
     }
     return(ex.NameEquals(errorCode.ToString(), comparisonType));
 }