コード例 #1
0
 public static string ToDescriptionString(this RepositiryExceptionType val, string suppliedValue)
 {
     DescriptionAttribute[] attributes = (DescriptionAttribute[])val
                                         .GetType()
                                         .GetField(val.ToString())
                                         .GetCustomAttributes(typeof(DescriptionAttribute), false);
     return(attributes.Length > 0
         ? attributes[0].Description + " Value: " + suppliedValue
         : "Undefined exception type.  Value: " + suppliedValue);
 }
コード例 #2
0
 public RepositoryException(RepositiryExceptionType type)
 {
     ExceptionType = type;
 }
コード例 #3
0
 public RepositoryException(RepositiryExceptionType type, int value) : base(type.ToDescriptionString(value.ToString()))
 {
     ExceptionType = type;
 }