I had a comment recently from ‘The Dag‘ asking if I could create some code which would check to ensure that none of the parameters for a methods were null. While this is quite a simple piece of code I thought I would reply in a post rather than answering in the comments as it is more likely to be found by anyone else who is looking to do the same.
The request is to allow for any number of parameters to be passed in and they all be checked, the suggested format by The Dag was;
Guard.NoArgumentsNull(() => arg1, arg2, arg3);
I didn’t keep to the format suggested exactly but I feel that the result meets all of The Dags requirements fully.