开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜