I'm experimenting with EntityFramework 4.3 using CodeFirst. I have worked with EF 4.0 ModelFirst and DatabaseFirst for about two years now and want to integrate CodeFirst into an exiting CRM Database project. (...but tried it without an existing Database!)
I am using VS 2010, VB.Net ans SQLEXPRESS Server 2008 for developing.
So I started with a NEW project using the msdn-Examples: "EF 4.2 Code First Walkthrough" ( http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-code-first-walkthrough.aspx )
and a VB.NET adaption from "Productivity Improvements for the Entity Framework" ( http://blogs.msdn.com/b/vbteam/archive/2010/06/21/productivity-improvements-for-the-entity-framework.aspx )
I quote: "That is 100% of the code you would write to get this program running. No separate model definition, XML metadata, config file or anything else is required. "
Well, that seems not to be true for my system. I installed EntityFramework 4.3 with NuGet Packet Manager and the Reference is correctly there.
I first tried it without App.Config - adaption. I got the InvalidOperationException
... not mapped:
"The type 'CodeFirstSample.MyDataAccessDemo.Program + Product' was not mapped."
I added a database connectionString to the app.config for my SQL Server-connection, created a database "Products" and tried again. Same error...
What did I do wrong?
I googled a lot but couldn't find any hints.