You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

2 years ago
  1. using System;
  2. namespace SqlSugar
  3. {
  4. public class Check
  5. {
  6. public static void ThrowNotSupportedException(string message)
  7. {
  8. message = message.IsNullOrEmpty() ? new NotSupportedException().Message : message;
  9. throw new UtilExceptions("SqlSugarException.NotSupportedException:" + message);
  10. }
  11. public static void ArgumentNullException(object checkObj, string message)
  12. {
  13. if (checkObj == null)
  14. throw new UtilExceptions("SqlSugarException.ArgumentNullException:" + message);
  15. }
  16. public static void ArgumentNullException(object [] checkObj, string message)
  17. {
  18. if (checkObj == null|| checkObj.Length==0)
  19. throw new UtilExceptions("SqlSugarException.ArgumentNullException:" + message);
  20. }
  21. public static void Exception(bool isException, string message, params string[] args)
  22. {
  23. if (isException)
  24. throw new UtilExceptions(string.Format(message, args));
  25. }
  26. }
  27. }