Hello,
I switched from LLBLgen framework to Entity framework generation.
Now i created a small project to as a test project.
But i have a problem that i don't understand.
Steps overview
1) Create table country and add some ...
2) Run LLBLgen tool and use database with country table
3) I Selected Entity framework v4.0 and select SD.Entityframework.v4 (DbContext API)
4) use nuget to add entity framework to persistence project
5) Add missing refference to other project
6) Create new console project with references
I created this peace code to test
MyDataContext dc = new MyDataContext ();
var lijst = from x in dc.Countries select x;
foreach (Country land in lijst)
{
Console.WriteLine(land.Description);
}
This is the CORRECT SQL that is generated:
lijst = {SELECT
[Extent1].[Active] AS [Active],
[Extent1].[Countrycode2] AS [Countrycode2],
[Extent1].[Countrycode3] AS [Countrycode3],
[Extent1].[Description] AS [Description],
[Extent1].[Id] AS [Id]
FROM [dbo].[Country] AS [Extent1]}
but in the foreach i have an error, "An error occurred while executing the command definition. See the inner exception for details."
inner exception -->
Invalid object name 'dbo.Country
The stange part is when i run the select statement i get result in management studio.
Can anyone help me out on this problem i have.
Thanks