1

我想使用 autofac 在 asp.net mvc 4 中设置 ModelBinders.Binders.DefaultBinder=new SmartBinder(),这样做的正确方法是什么?

4

1 回答 1

1

在您的 Global.asax.cs 中;

protected void Application_Start()
    {

        System.Web.Mvc.ModelBinders.Binders.DefaultBinder = new SmartBinder();
    }

Autofac 不需要这样做。

于 2013-09-27T08:59:22.047 回答