Is it possible to loop through a function arguments to check if any of them is null(or check them by another custom function)?
something like this:
public void test (string arg1, string arg2, object arg3, DataTable arg4)
{
foreach (var item in argus)
{
if( item == null)
{
throw;
}
}
// do the rest...
}
what is the correct keyword for “argus”? I know that this is possible by some more if statement but looking for a faster way…
I suppose you don’t want to change to params each method in your project(s). You can use PostSharp, but there are other methods, depends on your framework.
http://www.sharpcrafters.com/ to get PostSharp, also you can find doc there.