I want to get the model during BindModel and cast it to a type specified in the bindingContext:
var reportFormTypeName = bindingContext.ValueProvider.GetValue(bindingContext.ModelName + ".TableInputModelTypeName");
Type reportFormType = Type.GetType("MyNameSpace.ViewModels." + reportFormTypeName.AttemptedValue);
var model = (reportFormType)bindingContext.ModelMetadata.Model;
This wont work however - i'm guessing it's a simple reflection thing that i can't get my tired brain to sort out - anyone got any clues?
:)