public static void Exception <TException>(string message = null, object[] args = null, params KeyValuePair <string, object>[] data) where TException : Exception, new() { throw ExceptionProvider.GenerateException <TException>(message, args, data); }
internal static void ThrowIfNull <T, TException>(this T obj, string message = null) where TException : Exception, new() { if (obj == null) { throw ExceptionProvider.GenerateException <TException>(message); } }
public static void IfNot <TException>(Func <bool> predicate, string message = null, object[] args = null, params KeyValuePair <string, object>[] data) where TException : Exception, new() { if (!predicate()) { throw ExceptionProvider.GenerateException <TException>(message, args, data); } }
public static void IfNullOrEmpty <TException>(string obj, string message = null, object[] args = null, params KeyValuePair <string, object>[] data) where TException : Exception, new() { if (string.IsNullOrWhiteSpace(obj)) { throw ExceptionProvider.GenerateException <TException>(message, args, data); } }