title: Unwanted Decimal Truncation
body: <p>My Model:</p>
  
  <pre><code>public class Product
  {
      ...
          public decimal Fineness { get; set; }
      ...
  }
  </code></pre>
  
  <p>Seeding the Database:</p>
  
  <pre><code>new List&lt;Product&gt;
          {
              new Product { ..., Fineness = 0.757M, ... },
              new Product { ..., Fineness = 0.674M, ... },
              new Product { ..., Fineness = 0.475M, ... }
          }.ForEach(p =&gt; context.Products.Add(p));
  </code></pre>
  
  <p>Querying the Database to test seeding:</p>
  
  <pre><code>var products = db.Products.ToList();
  foreach (var p in products)
  {
      S.D.Debug.WriteLine("ProductList: {0}, {1}", p.Name, p.Fineness);
  }
  </code></pre>
  
  <p>Console Output:</p>
  
  <pre><code>ProductList: Test Product, 0.75 
  ProductList: Test Product, 0.67 
  ProductList: Test Product, 0.47    
  </code></pre>
  
  <p>Am I doing something really silly or something??? Everything is being truncated to 2 decimal places.</p>
  
  <p>Solution - Thanks to Patrick:</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
      modelBuilder.Entity&lt;Product&gt;().Property(x =&gt; x.Fineness).HasPrecision(10, 5);
  }
  </code></pre>