title: Automapper says Mapper.Map is obsolete, global mappings?
body: <p>I had defined in my project a global Automapper configuration that would allow me to use <code>Mapper.Map&lt;targetType&gt;(sourceObject);</code> in my code. (See my configuration below.)</p>
  
  <p>I updated the NuGet package, and I see the message that Mapper.Map is obsolete/depreciated. I went back to Automapper on GitHub and see examples like this:</p>
  
  <pre><code>[Test]
  public void Example()
  {
      var config = new MapperConfiguration(cfg =&gt;
      {
          cfg.CreateMap&lt;Source1, SubDest1&gt;().FixRootDest();
          cfg.CreateMap&lt;Source2, SubDest2&gt;().FixRootDest();
      });
  
      config.AssertConfigurationIsValid();
  
      var mapper = config.CreateMapper();
  
      var subDest1 = mapper.Map&lt;Source1, SubDest1&gt;(new Source1 {SomeValue = "Value1"});
      var subDest2 = mapper.Map&lt;Source2, SubDest2&gt;(new Source2 {SomeOtherValue = "Value2"});
  
      subDest1.SomeValue.ShouldEqual("Value1");
      subDest2.SomeOtherValue.ShouldEqual("Value2");
  }
  </code></pre>
  
  <p>Am I going to have to create a configuration in EVERY method that uses a mapping?</p>
  
  <p>My current global configuration:</p>
  
  <pre><code>namespace PublicationSystem.App_Start
  {
      public class AutoMapperConfig
      {
          public static void CreateMaps()
          {
              CreateProjectMaps();
          }
  
          private static void CreateProjectMaps()
          {
              Mapper.CreateMap&lt;Project, ProjectCreate&gt;();
              Mapper.CreateMap&lt;Project, ProjectSelectable&gt;();
              //...
          }
      }
  }
  </code></pre>
  
  <p><strong><em>UPDATE:</em></strong> Thanks to some coaching from Scott Chamberlain I have created a class like this:</p>
  
  <pre><code>    public class MkpMapperProfile : AutoMapper.Profile
      {
          protected override void Configure() 
          {
              this.CreateMap&lt;Project, ProjectCreate&gt;();
  
              this.CreateMap&lt;Project, ProjectSelectable&gt;();
  
              this.CreateMap&lt;Project, ProjectDetails&gt;();
  
              // Many Many other maps
          }
      }
  </code></pre>
  
  <p>I'm thinking I should have the 'MapperConfiguration' in my BaseController class. I started to do something like this:</p>
  
  <pre><code>public partial class BaseController : Controller
  {
  
      private MapperConfiguration mapConfig;
  
      public BaseController()
      {
          db = new MkpContext();
          SetMapperConfig();
      }
  
      private void SetMapperConfig()
      {
          mapConfig = new MapperConfiguration(cfg =&gt;
              {
                  cfg.AddProfile&lt;MkpMapperProfile&gt;();
              });
      }
  
      public BaseController(MapperConfiguration config)
      {
          db = new MkpContext();
          this.mapConfig = config;
      }
  }
  </code></pre>
  
  <p>Am I on the right track?</p>