开发者

How to call DataAnnotations in business layer (ASP.NET)?

I would like to use the DataAnnotations on my transfer objects. However how do I开发者_如何学编程 call them in the business layer to verify the input?

Is this by some method call or reflection?

I do not use ASP.NET but standard ASP.NET and would like to call the data annotations in the business layer.


I think you are looking for the Validator class in the following link. It has a variety of methods which essentially give you a boolean letting you know if something is valid and the associated error messages.

.net 4 and silverlight only though.

http://msdn.microsoft.com/en-us/library/dd382181.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜