SqlSugar/Src/Asp.Net/SqlSugar/Utilities/Check.cs

34 lines
1.1 KiB
C#
Raw Normal View History

2017-01-07 21:54:51 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SqlSugar
{
public class Check
{
public static void ThrowNotSupportedException(string message)
{
message = message.IsNullOrEmpty() ? new NotSupportedException().Message : message;
2018-12-07 16:32:42 +08:00
throw new SqlSugarException("SqlSugarException.NotSupportedException" + message);
2017-01-07 21:54:51 +08:00
}
public static void ArgumentNullException(object checkObj, string message)
{
if (checkObj == null)
2018-12-07 16:32:42 +08:00
throw new SqlSugarException("SqlSugarException.ArgumentNullException" + message);
2017-01-07 21:54:51 +08:00
}
2017-08-26 00:33:57 +08:00
2017-05-14 12:27:42 +08:00
public static void ArgumentNullException(object [] checkObj, string message)
{
if (checkObj == null|| checkObj.Length==0)
2018-12-07 16:32:42 +08:00
throw new SqlSugarException("SqlSugarException.ArgumentNullException" + message);
2017-05-14 12:27:42 +08:00
}
2017-01-07 21:54:51 +08:00
public static void Exception(bool isException, string message, params string[] args)
{
if (isException)
2018-12-07 16:32:42 +08:00
throw new SqlSugarException(string.Format(message, args));
2017-01-07 21:54:51 +08:00
}
}
}