C# 显式绑定模型
一般来说,我将使用下面的代码对客户模型进行绑定C# 显式绑定模型,c#,asp.net-mvc,model-binding,C#,Asp.net Mvc,Model Binding,一般来说,我将使用下面的代码对客户模型进行绑定 [HttpPost] public ActionResult Create(Customer model) { ... } 现在,我想稍后提高绑定,而不是立即,像这样 [HttpPost] public ActionResult Create() { //some operations first ... //binding will start here var model={Bind - To - Customer}
[HttpPost]
public ActionResult Create(Customer model)
{
...
}
现在,我想稍后提高绑定,而不是立即,像这样
[HttpPost]
public ActionResult Create()
{
//some operations first
...
//binding will start here
var model={Bind - To - Customer}
...
}
那么,我如何才能做到这一点,这可能吗
非常感谢您提出的任何建议您可以使用或方法:
[HttpPost]
public ActionResult Create()
{
//some operations first
...
// binding will start here
var model = new Customer();
UpdateModel(customer);
...
}