问题
Is it enought to call Mapper.Initialize in Application_Start() in global.asax or should some IoC container take care of the lifetime scoping ?
protected void Application_Start()
{
Mapper.Initialize(x=>x.AddProfile(new SomeProfile()));
}
回答1:
Should be enough. I've never had a problem with initializing Automapper this way.
来源:https://stackoverflow.com/questions/5537192/automapper-configuration