示例#1
0
 /// <summary>
 /// Creates throw context with defined exception factory and message template.
 /// </summary>
 /// <param name="exceptionFactory">Exception factory</param>
 /// <param name="messageTemplate">Message template</param>
 public static ThrowContext Exception(
     Func <string, string, Exception> exceptionFactory,
     Func <string, string>?messageTemplate = null)
 {
     return(ThrowContext.Create(exceptionFactory, messageTemplate ?? IsNotValid));
 }
示例#2
0
 /// <summary>
 /// Creates throw context with ArgumentNullException factory and defined message template.
 /// </summary>
 /// <param name="messageTemplate">Message template</param>
 public static ThrowContext ArgumentNullException(
     Func <string, string>?messageTemplate = null)
 {
     return(ThrowContext.Create(ArgumentNullExceptionFactory, messageTemplate ?? CanNotBeNull));
 }