title: AutoMapper mapping fails randomly when defining mappings locally
body: <p>We are configuring automapper for my asp.net MVC/Web API project in the method definition as follows.</p>
  
  <pre><code>public HttpResponseMessage GetDetails(int assignmentId)
  {     
      var valuation = _valuationRepository.GetOneById(assignmentId);
  
      Mapper.CreateMap&lt;UserLicenses, UserLicenseResponseModel&gt;()
      .ForMember(dest =&gt; dest.State, opt =&gt; opt.MapFrom(src =&gt; src.States.StateCode))
      .ForMember(dest =&gt; dest.UserId, opt =&gt; opt.MapFrom(src =&gt; src.UserId))
      .ForMember(dest =&gt; dest.FullName, opt =&gt; opt.MapFrom(src =&gt; (src.UserProfile != null) ? (src.UserProfile.FirstName + ' ' + src.UserProfile.LastName) : " "));
  
      Mapper.CreateMap&lt;AdditionalExpenses, AdditionalExpensesResponseModel&gt;();
      Mapper.CreateMap&lt;ValuationAssignment, ValuationAssignmentResponseModel&gt;();
  
      var model = Mapper.Map&lt;ValuationAssignmentResponseModel&gt;(valuationAssignment);    
      return Request.CreateResponse(HttpStatusCode.OK, new  { Assignment = model });
  }
  </code></pre>
  
  <p>We are noticing that api is randomly not mapping values and response json is returning null values for the mapped fields.</p>
  
  <p>When this happens I'm recycling the app pool and it seems to work for a period of time and we run into the issue again.</p>
  
  <p>Documentation refers to storing all the mappings in Application_Start in Global.asax. However, we are setting them in the method definition - Is that why we are seeing this issue? </p>