The great thing about writing code is that you are almost assured that whatever you think would “be cool” someone out there in the world has written already. For example, I wanted to use DataAnnotations on my WCF model for validation. Silly me, I thought it would just work. I mean, it makes sense, right? Well, while it doesn’t work out of the box, it is something that makes sense, so someone wrote the code already!
I found this post over at DevTrends. It explains the logic behind using DataAnnotations for validation. My favorite part:
So a fantastic validation framework is available with .NET. All we need to do is integrate it into WCF.
Really, I am surprised this isn’t part of the framework, but whatever. Paul created a NuGet package, and that makes it so easy that it may as well be part of the framework. Thanks, Paul!