ASP.Net MVC モデル バインダー内では、バインドされた型のオブジェクトを作成し、そのプロパティを更新できます。
例えば
public override object BindModel(ControllerContext controllerContext,
ModelBindingContext bindingContext)
{
ParentType boundModel = null;
if (bindingContext.ModelType == typeof(ParentType))
{
var myFactory = new MyFactory();
var someValue = bindingContext.ValueProvider.GetValue
("someFieldId").AttemptedValue;
ChildType child = myFactory.Create(someValue);
BindModel(child);
boundModel = child;
}
return boundModel;
}
このコードで、コントローラーからの TryModelUpdate() のような BindModel(child) 呼び出しに似たものがあるかどうかを知りたいですか?