Automapper configuration

那年仲夏 提交于 2019-12-24 10:09:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!