Need to insert duplicate records in Entity Framework with list
<p>I am trying to insert duplicate record using EF by below code</p>

<pre><code>db.Set&lt;TEntity&gt;().AddRange(lstEntity);
db.SaveChanges();
</code></pre>

<p><code>lstEntity</code> is a list of type <code>TEntity</code>.</p>

<p>Suppose, I have 6 elements in <code>lstEntity</code>, 3 of them are duplicate.</p>

<p>On the first line in <code>AddRange</code> it only adds 4 elements, because 3 elements were duplicate so it adds 1 (3 duplicated) + 3 distinct records so it becomes 4.</p>

<p>And therefore, it inserts only 4 records in the DB.</p>

<p>I need to allow this duplicate thing and want to insert all the 6 elements (duplicate and distinct both).</p>