title: Why does Entity Framework truncate string value while saving into database?
body: <p>I have a problem with Entity Framework, it's truncating a string value while saving into database</p>
  
  <p>I have database column <code>Description nvarchar(max)</code> in SQL Server 2014, and a property like this on my model class:</p>
  
  <pre><code>public string Description { get; set; }
  </code></pre>
  
  <p>I used this code to insert into database</p>
  
  <pre><code>db.EnitityName.Add(object);
  db.SaveChanges();
  </code></pre>
  
  <p>Normally it works to save records, there is no problem, but when string exceeds more than 40k characters in <code>Description</code> property, it's saved value is truncated to the last characters from 40k to above.</p>
  
  <p>E.g we have a 50k characters string, it saves only the first 40k characters and truncates the last 10k characters.</p>
  
  <p>Is there something I did wrong, or does Entity Framework have a limitation on the string length, or database limitation in nvarchar(max)?</p>
  
  <p>Please help me, I appreciate your valuable time in advance.</p>
  
  <p>Thanks</p>