Why entity framework not inserting data to .mdf file?
<p>I am using <strong>console application</strong> to insert data into .mdf file which is in App_Data folder and .edmx file in project folder.</p>

<p>The same below code is working with mvc but not console application.</p>

<p>Table is:</p>

<pre><code>CREATE TABLE [dbo].[tbLegalDetails] (
[LegalStatusId]           INT            NOT NULL,
[LegalStatusName]         TEXT           NULL,
[LegalStatusHeading]      TEXT           NULL,
[PatentOfInvention]       NVARCHAR (100) NULL,
[EventCode]               VARCHAR (100)  NULL,
[EventExplination]        TEXT           NULL,
[CCOfCorrespondingPatent] NVARCHAR (100) NULL,
[CorrespondingPatentD]    INT            NULL,
PRIMARY KEY CLUSTERED ([LegalStatusId] ASC)
);
</code></pre>

<p>Code to insert data is:</p>

<pre><code>ConsoleApplication__DynamicWebBrowserDatabaseEntities db = new ConsoleApplication__DynamicWebBrowserDatabaseEntities();
List&lt;tbLegalDetail&gt; hLegalDetaili = db.tbLegalDetails.ToList();

[Here count is shown as 0]

tbLegalDetail tbLegalDetail = new tbLegalDetail();
tbLegalDetail.LegalStatusId = 3;
tbLegalDetail.LegalStatusName = "INPADOC legal";
tbLegalDetail.LegalStatusHeading = "COMPOSITIONS ANDAPY";
tbLegalDetail.PatentOfInvention = "2003287377";
tbLegalDetail.EventCode = "FGA";
tbLegalDetail.EventExplination = "LETTSTANDARD PATENT";
tbLegalDetail.CCOfCorrespondingPatent = "dfs";
tbLegalDetail.CorrespondingPatentD = 1212;
db.tbLegalDetails.Add(tbLegalDetail);
db.SaveChanges();
List&lt;tbLegalDetail&gt; hLegalDetail = db.tbLegalDetails.ToList();

[Here count is shown as 1]

Console.ReadLine();
</code></pre>

<p>but when I look into the .mdf file I cant see the added row.
When I run again I will show count as 0.</p>

<p>Please help.</p>