title: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Int32'
body: <p>The error is</p>
  
  <pre class="lang-none prettyprint-override"><code>System.InvalidCastException occurred HResult=0x80004002 Message=Unable to 
     cast object of type 'System.String' to type 'System.Int32'. Source=&lt;Cannot 
     evaluate the exception source&gt; StackTrace: at 
  Microsoft.EntityFrameworkCore.ChangeTracking.Internal.SimpleNullableDependentKeyValueFactory 1. TryCreateFromBuffer(ValueBuffer valueBuffer, TKey&amp; key) at 
  Microsoft.EntityFrameworkCore.Query.Internal.WeakReferenceIdentityMap`1.CreateIncludeKeyComparer(INavigation navigation, ValueBuffer valueBuffer)
  </code></pre>
  
  <p>I'm not sure how to troubleshoot/solve this error.  Checking-on all Exception Settings doesn't break on the error nor does it provide any insight (presumably because it isn't my code?).  </p>
  
  <p>Am using EntityFrameworkCore.SQLServer 1.0.4.  Cannot upgrade to newer version at this time but it runs successfully when using 1.1.1.   </p>
  
  <p>Using SQL Server 2016.  VS 2017.  </p>
  
  <p>The problem occurs when invoking the ToList on a complicated IQueryable.  </p>
  
  <p>How is the error solved?  Any recommendations on how to proceed?</p>