MVC4 RC WebApi parameter binding

后端 未结 2 680
青春惊慌失措
青春惊慌失措 2021-01-04 14:36

I upgraded from MVC4 beta to RC and the latest autofac. The following action was binding properly, but now both parameters are null. I see they changed things about the Fo

2条回答
  •  清酒与你
    2021-01-04 14:59

    When you want to avoid using a DTO object, try this:

    [HttpPost]    
    RedirectModel MyAction(dynamic value1, dynamic value2) {
        string sValue1 = value1;
        string sValue2 = value2;
    

提交回复
热议问题