Guard.cs 524 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Bowin.Common.Utility
  6. {
  7. public static class Guard
  8. {
  9. public static void ArgumentNotNullOrEmpty(object value, string name)
  10. {
  11. if (null == value)
  12. {
  13. throw new ArgumentNullException(name);
  14. }
  15. if (value is string && string.Empty.Equals(value))
  16. {
  17. throw new ArgumentNullException(name);
  18. }
  19. }
  20. }
  21. }