public void DoSomething(string input) { VerifyArgument.IsNotNull(input, nameof(input)); // do work with input }
public void DoSomethingElse(object input1, object input2) { VerifyArgument.IsNotNull(input1, nameof(input1)); VerifyArgument.IsNotNull(input2, nameof(input2)); // do work with input1 and input2 }In this example, the VerifyArgument.IsNotNull method is being used to ensure that both the input1 and input2 arguments being passed into the DoSomethingElse method are not null. If either of them are null, an ArgumentException will be thrown. The VerifyArgument class is typically part of a larger package or library that provides common utility methods for building robust and maintainable code. These libraries may include additional methods for validating arguments, logging, error handling, and other common programming tasks. The specific library that the VerifyArgument method is part of will depend on the context in which it is being used.