I working on a method that does something given a string parameter. A valid value for the string parameter is anything other than null or string.Empty. So my code looks li
Why don't use this code?
private void SomeMethod(string someArgument)
{
//chek only NULL
if(ReferenceEquals(someArgument,null))
throw new ArgumentNullException("someArgument");
// and after trim and check
if (someArgument.Trim() == String.Empty)
throw new ArgumentException("Input cannot be empty", "someArgument");
// do some work
}