C# 自定义活页夹工作正常,但模型不会更新

C# 自定义活页夹工作正常,但模型不会更新,c#,model-view-controller,model-binding,C#,Model View Controller,Model Binding,我有一个模型,它看起来像这样: public class MyModel { public List<SomeBaseClass> list {get; set;} public string SomeProperty {get; set;} } 但当视图调用操作时,我的模型不完整: public string SomeAction(MyModel model) { // <~~ It calls the custom binder before coming t

我有一个模型,它看起来像这样:

public class MyModel {
   public List<SomeBaseClass> list {get; set;}
   public string SomeProperty {get; set;}
}
但当视图调用操作时,我的模型不完整:

public string SomeAction(MyModel model) { // <~~ It calls the custom binder before coming to here, which is correct
   // As the result, the model variable is an instance of MyModel, but the list is null
   return "somethhing";
}

publicstringsomeaction(mymodelmodel){/好的,我知道了。我必须在模型类声明旁边添加binder属性,以确保在将模型传递给action方法时调用binder

[ModelBinder(typeof(MyModelBinder))]
public class MyModel
{
...
}
这并不明显,因为即使此属性不存在,仍会调用自定义绑定器,但由于某些原因,它的输出不会发送到操作,而是使用默认绑定器的输出

[ModelBinder(typeof(MyModelBinder))]
public class MyModel
{
...
}