I have the below method, which I need to check for whether the arguments are empty or null.
public DB Where(string field, string operat, string value, s
What I can suggest is this:
private string _nullChecker(string _value){
if (string.IsNullOrWhiteSpace(_value))
throw new ArgumentException(_value + "Cannot be null or be empty");
return _value;
}
then, in your Where string statement
_Where = " WHERE " + _nullChecker(field) + " " + __nullChecker(operat) + " @" + _nullChecker(field) + "1 " + _nullChecker(andOr) + " " + _nullChecker(field2) + " " + _nullChecker(operat2) + " @" + _nullChecker(field2) + "2 ";
Not sure with this though. Haven't checked it with actual code. :) Hope this helps