Does Winforms support Code-First Entity Framework. I know ASP.net MVC support it, but how about Winforms?
I create connection string in app.config:
<connectionStrings>
<add name ="Transaction" connectionString="DataSource=|DataDirectory|Transaction.sdf" providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
I also create Transaction class with all the fields, and Transaction DbContext, but when I compile, it does not create the sdf file automatically.
Thank you.
UPDATE I added this two lines, but is still not working:
Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
Database.SetInitializer(new DropCreateDatabaseIfModelChanges<EmvTransactions>());
It gives me this error:
> An error occurred while updating the entries. See the inner exception
> for details.