Utility used to validate method input parameters.
-
Install-Package Intergen.Argument
-
OPTIONAL - if you use resharper, import the live template in the root folder. This will let you use shortcuts like checkn, checkne etc.
-
Start validating public methods!
public static string SomeMethod(string inputString, Object someObject)
{
Argument.CheckIfNullOrEmpty(inputString, "inputString");
Argument.CheckIfNull(someObject, "someObject");
// Do stuff with validated arguments...
return "An exception will be thrown with good information if any of the inputs are invalid!";
}