title: EntityFramework Parameter value is out of range
body: <p>Despite of all already read answers, cannot deal with <strong>Decimal</strong> and EF.
  I've a SQLServer 2012 table (<em>Traffico</em>) who defines this field:</p>
  
  <pre><code>[traffico_out] [decimal](30, 10) NULL
  </code></pre>
  
  <p>If I test with this simple query:</p>
  
  <pre><code>UPDATE dbo.Traffico
  SET traffico_out=55534448359.141929
  WHERE id=10;
  </code></pre>
  
  <p>All works fine and the decimal value is stored.</p>
  
  <p>I've to deploy an ASP.NET MVC 4 application using Entity Framework 6, <strong>Database First</strong> approach.
  I've generated the model starting from existing table.</p>
  
  <p><strong>Context</strong></p>
  
  <pre><code>public partial class PeeringEntities : DbContext
  {
  
    public PeeringEntities()
      : base("name=PeeringEntities")
    {
    }
  
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
      throw new UnintentionalCodeFirstException();
    }
  
    public virtual DbSet&lt;Traffico&gt; Traffico { get; set; }
  
  }
  </code></pre>
  
  <p><strong>Table entity</strong></p>
  
  <pre><code>public partial class Traffico
  {
    public int id { get; private set; }
    public Nullable&lt;decimal&gt; traffico_out { get; set; }
  }
  </code></pre>
  
  <p><strong>EDMX</strong></p>
  
  <pre><code>&lt;EntityType Name="Traffico"&gt;
    &lt;Property Name="id" Type="int" StoreGeneratedPattern="Computed" Nullable="false" /&gt;
    &lt;Property Name="traffico_out" Type="decimal" Precision="30" Scale="10" /&gt;
  &lt;/EntityType&gt;
  </code></pre>
  
  <p>All the code ablove has been auto-generated.</p>
  
  <p><strong>Exception</strong></p>
  
  <p>When I attempt to add a new record to '<em>Traffico</em>' table, I get an out of range error. In my Controller (where <em>db</em> is DbContext):</p>
  
  <pre><code>Traffico _new_item = new Traffico();
  _new_item.traffico_out = 5283148511.91876M;
  db.Traffico.Add(_new_item);
  db.SaveChanges();
  </code></pre>
  
  <p>At SaveChanges time I got a DbUpdateException:</p>
  
  <pre><code>InnerException: An error occurred while updating the entries. See the inner exception for details.
  InnerException -&gt; InnerException: {"Parameter value '5283148511,91876' is out of range."}
  </code></pre>
  
  <p>What I'm doing wrong?</p>
  
  <p><strong>EDIT</strong>
  Looking at my output directory I've found three files that are generated from my EDMX:</p>
  
  <ol>
  <li>.csdl </li>
  <li>.msl </li>
  <li>.ssdl</li>
  </ol>
  
  <p>Despite of edmx precision and scale, I've found in the .ssdl:</p>
  
  <pre><code>&lt;Property Name="traffico_out" Type="decimal" Precision="12" Scale="5" /&gt;
  </code></pre>
  
  <p>Now I'm really confused: how can I change this?</p>