EF retrieves incorrect decimal precision
<p>I'm using Entity Framework 6.1, code-first. I'm trying to store/retrieve a decimal from SQL Server, but the correct precision isn't retrieved. I read from a .csv file, process the data, then insert into the DB.</p>

<ul>
<li>Value in the .csv file: <code>1.1390</code></li>
<li>Value when saved as <code>decimal</code> from the import: <code>1.1390</code></li>
<li>Value inserted into DB: <code>1.139</code></li>
<li>Value actually stored/shown in SSMS: <code>1.1390</code></li>
<li>Value when manually running the query SQL Profiler captures for the retrieval: <code>1.1390</code></li>
<li>Value retrieved by EF: <strong><code>1.1300</code></strong></li>
</ul>

<p>Everything is working except for retrieving the value. I've tried the solution given in every single other SO post (below), but it has no effect. What's going wrong here? How can I retrieve the correct value with the proper precision?</p>

<p>Supposed solution:</p>

<pre><code>modelBuilder.Entity&lt;ClassA&gt;().Property(p =&gt; p.MyDecimal).HasPrecision(19, 4);
</code></pre>

<p>Retrieval method, returns type <code>ClassA</code> with incorrect precision:</p>

<pre><code>_poRepository.Table.FirstOrDefault(p =&gt; p.CompNumberA == compNum &amp;&amp; 
                                        p.LineNumber == lineNumber);
</code></pre>

<p>Comparison between the two decimal values:</p>

<pre><code>import.MyDecimal != dbValue.MyDecimal
</code></pre>

<p><code>ClassA</code>:</p>

<pre><code>public class ClassA
{
    // properties
    public virtual decimal MyDecimal { get; set; }
}
</code></pre>