I have an MVC project where I am using AutoMapper to map my Entity Framework Entities to View Models. The code that defines the mappings is in a boostrapper class that is called automatically when the application starts (App_Start, Global.asax)
I am doing some refactoring of my code to put all of my business logic in a Service Layer because we need to implement a batch process that runs daily which is doing some of the same logic as the MVC app.
One of the problems I am running into is now I need to map my database entities to some domain objects in my service layer. I think everything would still work fine in the MVC application because the bootstrapper is still being called in Global.asax.
Is there a way I can have my mapping code work for both my MVC application and another non-MVC application (could be a WCF service, console app, etc.) Where can I put this mapping code so it would get called by both applications only once?