【发布时间】:2013-02-09 23:10:00
【问题描述】:
什么时候使用模型绑定以及什么时候使用参数?
我和大学讨论过使用参数以及何时使用模型
我对搜索过滤器的回答
场景 public actionresult search(int?UserId, string name, int idtype2, string typeRequest1, string type2){ code}
如果我有多个参数进入动作,最好使用模型绑定器,如果我有多个参数,因为它更易于使用并且模型包含所有参数并且可以更容易扩展,特别是如果我对 actionresults 进行了多次测试添加新参数并不涉及使用方法重写所有测试
你有什么想法?
【问题讨论】:
标签: asp.net-mvc