1
是否足夠在global.asax的Application_Start()中調用Mapper.Initialize,或者某個IoC容器是否應該關注生命週期範圍?自動映射器配置
protected void Application_Start()
{
Mapper.Initialize(x=>x.AddProfile(new SomeProfile()));
}
是否足夠在global.asax的Application_Start()中調用Mapper.Initialize,或者某個IoC容器是否應該關注生命週期範圍?自動映射器配置
protected void Application_Start()
{
Mapper.Initialize(x=>x.AddProfile(new SomeProfile()));
}
應該足夠了。我從來沒有這樣初始化Automapper的問題。
AutoMapper運行非常單一的ish – 2011-04-04 18:48:08