I'm trying to implement some custom model metadata in ASP.NET MVC 3. I can't use data annotation attributes since some of the metadata could change based on configured values, so I need a solution that will let me set the metadata on every request. I've been reading about custom model metadata providers, but I can't find anything about support for dynamic metadata scenarios.
Does the MVC framework cache the metadata from the model metadata provider, or will the CreateMetadata method be called on every request? Is a custom model metadata provider a good solution for dynamic metadata, or should I just put it in the view model?
Edit: This isn't necessarily validation metadata I'm talking about, so I'm not looking for a validation specific solution. It could just be metadata to be displayed or used by the view (in HTML 5 data attributes for example).
Another example might be a database driven field label. Usually one would use the Name property of the Display attribute, but this wouldn't work if you wanted to dynamically set the display name based on a value in the database.