参数类型异常
我们在写一个方法的时候,经常会写很多判断传入的参数的值是否为null的程序,我在看castle IOC的源代码的时候看到他的做法就是抛出一个参数类异常,如下:
if (list == null)
throw new ArgumentNullException("list");
if (list == null)
throw new ArgumentNullException("list");

浙公网安备 33010602011771号