user256034
user256034

Reputation: 4369

Automapper configuration

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()));
}

Upvotes: 1

Views: 1743

Answers (1)

PatrickSteele
PatrickSteele

Reputation: 14677

Should be enough. I've never had a problem with initializing Automapper this way.

Upvotes: 4

Related Questions