Can we use validator class in method parameter with validation application block?
I am using validation application block and new in this. My question is that can we give the validator class to method pa开发者_Go百科rameter? like used it with WCF
public void getTaskList([some validator class] String number) { ....}
Regards, Girish
imho you should not use a validation framework on simple parameters since they are the contract for the method.
It's just as throwing an ArgumentNullException
if parameter User owner
is null and then to validation on the actual User
object.
If you need validation, put all method arguments in a class and validate that class.
精彩评论