Beware of breaking changes to ModelBindingContext in MVC2 Preview 2
October 1, 2009 – 17:53
ASP.NET MVC2 Preview 2 was released earlier today. One thing to be aware of is the breaking changes to the ModelBindingContext.
Both the Model and ModelType properties are obsolete and their setters throw exceptions. However, they are not marked with the obsolete attribute so you will not get a compiler warning if you are using them – you will only get an exception at runtime.
2 Responses
Hi Jeremy, with the new ModelMetaData and ModelMetaDataProvider it would be possible to expose fluent validation metadata to the view as json, then hook that up to jQuery validator or xVal..
Hi Jake,
You are correct – we already have some limited support for xVal in the current trunk and I’m planning on adding support for MVC2′s ModelMetaDataProvider going forward.
Jeremy