title: Automapper custom resolver throws null exception
body: <p>So i have a mobile Service running just fine and want to add DTOs' notation.
  I use AutoMapper to map between my models and the DTOs models but the complexity of the database and the result i want forces me to use custom resolvers which in turn throws null Exceptions.</p>
  
  <p>Specifically - The Mapper Initialization</p>
  
  <pre><code>Mapper.Initialize(cfg =&gt;
          {
              cfg.CreateMap&lt;Contact, MobileContact&gt;()
                  .ForMember(mobcont =&gt; mobcont.Favorite, map =&gt; map.ResolveUsing&lt;ContactResolver&gt;());//.UseValue(true));//
              cfg.CreateMap&lt;MobileContact, Contact&gt;();
          });
  </code></pre>
  
  <p>And my custom Resolver is </p>
  
  <pre><code>public class ContactResolver :  ValueResolver&lt;Contact, bool&gt; 
  {
      protected override bool ResolveCore(Contact a)
      {
          return true;
      }
  }
  </code></pre>
  
  <p>Edited : Favorite is a bool of course </p>
  
  <p><strong>If i dont use the custom resolver and use the .UseValue(true) it works just fine</strong></p>
  
  <p>Though a common get request with the custom resolver as shown above throws the following exception:</p>
  
  <pre><code>Exception=System.NullReferenceException: Object reference not set to an instance of an object.
     at AutoMapper.QueryableExtensions.Extensions.ResolveExpression(PropertyMap propertyMap, Type currentType, Expression instanceParameter)
     at AutoMapper.QueryableExtensions.Extensions.CreateMemberBindings(IMappingEngine mappingEngine, TypePair typePair, TypeMap typeMap, Expression instanceParameter, IDictionary`2 typePairCount)
     at AutoMapper.QueryableExtensions.Extensions.CreateMapExpression(IMappingEngine mappingEngine, TypePair typePair, Expression instanceParameter, IDictionary`2 typePairCount)
     at AutoMapper.QueryableExtensions.Extensions.CreateMapExpression(IMappingEngine mappingEngine, TypePair typePair, IDictionary`2 typePairCount)
     at AutoMapper.QueryableExtensions.Extensions.&lt;&gt;c__DisplayClass1`2.&lt;CreateMapExpression&gt;b__0(TypePair tp)
     at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
     at AutoMapper.Internal.DictionaryFactoryOverride.ConcurrentDictionaryImpl`2.GetOrAdd(TKey key, Func`2 valueFactory)
     at AutoMapper.QueryableExtensions.Extensions.CreateMapExpression[TSource,TDestination](IMappingEngine mappingEngine)
     at AutoMapper.QueryableExtensions.ProjectionExpression`1.To[TResult]()
     at Microsoft.WindowsAzure.Mobile.Service.MappedEntityDomainManager`2.Query()
     at azmobtestService.Models.MobileContactDomainManager.Query() in c:\Users\n.atlas\Source\Repos\JPhoneBook\Service\azmobtestService\Models\MobileContactDomainManager.cs:line 104
     at Microsoft.WindowsAzure.Mobile.Service.TableController`1.Query(), Id=75849f58-ccb0-4a6b-8a77-491f13fcb717, Category='App.Controllers.Tables'
  </code></pre>