Example #1
0
 /// <summary>
 /// 引发异常
 /// </summary>
 /// <param name="resultCollection">验证结果集合</param>
 /// <param name="appendAction">追加操作</param>
 public static void RaiseException(this ValidationResultCollection resultCollection,
                                   Action <ValidationException, ValidationResultCollection> appendAction = null) =>
 throw resultCollection.ToException(appendAction);
Example #2
0
 /// <summary>
 /// 引发异常
 /// </summary>
 /// <typeparam name="TException">异常类型</typeparam>
 /// <param name="resultCollection">验证结果集合</param>
 /// <param name="appendAction">追加操作</param>
 public static void RaiseException <TException>(this ValidationResultCollection resultCollection,
                                                Action <TException, ValidationResultCollection> appendAction = null) where TException : BingException, new() =>
 throw resultCollection.ToException(appendAction);