> Looks like a good idea to provide a model binder for each attribute based validation framework.
I'm not so sure. Architecturally, why would you want model binding have anything to do with validation?
Typically I'm going for an approach to validation that encompasses business rules just as easily as simple property formatting rules. Business rules obviously belong in the model
layer, not up in the HTTP-request-centric UI world of ASP.NET MVC model binders. So, typically I want my model layer to have the final say over whether something's valid, not a controller or its choice of model binder. The determination of validity might be
a combination of DataAnnotations attributes and arbitrary C# code.
I appreciate that Brad's post is explaining that DataAnnotations exist and he cites a simple way of using it. That's cool, but I think we've already pushed beyond that and have a
tidier arrangement. But what do you think? Am I missing some important point here?
> it looks like none of DataType attributes work correctly
I was a bit confused about that at first, too! I can only guess that the idea is that the DataAnnotations attributes are meant to convey information only, not behaviour. However,
it's strange that they have implemented the validation behaviour for some attributes but not others. Not totally certain why that is. I'm hoping that someone will make a nice open source runner for the DataAnnotations attributes which fills in the gap here
- don't really want to make xVal responsible for this.