Fast ArgumentNullException with attributes. It is possible?
- by Fraga
Hi.
Is there any fast way to verify null arguments
via attributes or something?
Convert this:
public void Method(type arg1,type arg2,type arg3)
{
if (arg1== null) throw new ArgumentNullException("arg1");
if (arg2== null) throw new ArgumentNullException("arg2");
if (arg3== null) throw new ArgumentNullException("arg3");
//Business Logic
}
Into something like this:
[VerifyNullArgument("arg1","arg2","arg3")]
public void Method(type arg1,type arg2,type arg3)
{
//Business Logic
}
Ideas? thanks guys.