示例#1
0
 public void Add(OldThing thing)
 {
     if (thing != null)
     {
         throw new ArgumentNullException("thing");
     }
 }
示例#2
0
 public void Add(OldThing thing)
 {
     if (thing != null)
     {
         throw new ArgumentNullException(nameof(thing));                                             //In C# 6.0 you can use nameof method to make future refactoring easier
     }
 }