This question is locked. New answers and comments are not allowed.
Hello,
I just worked my way through the "Getting Started with Model First Scenario" (appearing in the help file), but I encountered a few issues. I don't know if it matters, but I am running the sample against a SQL Server 2008 Express server, using Visual Studio 2010 Premium.
A first minor issue is that some of the column data types in the sample are not selectable, but I guess that is a minor issue as equivalent types are available (Int32->int, Varchar->varchar, Bit->bit).
The database creation script is generated fine, I can execute it, and I can see the three empty tables being created in the database.
The next minor problem is when entering the (C#) code of the sample: the "MyDatabaseDbContext" class doesn't exist, but a class named "MyDatabaseDbConnection" does exist (the same name used for the connection string in step 5). I assume that that is just a case of not all parts of the sample being consistent.
I can run the sample, but the results are not what I expected. A problem here is that the sample doesn't clearly state what should have been expected. What I observe is that whenever I run the sample a new row is inserted in the Regions and Students tables, but no row is inserted in the StudentsRegions table. Is that intended? It makes defining that relation table kindof pointless, isn't it?
Next I have one more question about the sample. How do I insert a second student in the same region without inserting a new region (in an independent execution, so emulating the case where the existing 'studentRegion' variable is not accessible for reuse). And related: what is the normal way to reference a new student to a region that may or may not exist in the databse yet - how do I get that region that may need to be created or may need to be retrieved?
I just worked my way through the "Getting Started with Model First Scenario" (appearing in the help file), but I encountered a few issues. I don't know if it matters, but I am running the sample against a SQL Server 2008 Express server, using Visual Studio 2010 Premium.
A first minor issue is that some of the column data types in the sample are not selectable, but I guess that is a minor issue as equivalent types are available (Int32->int, Varchar->varchar, Bit->bit).
The database creation script is generated fine, I can execute it, and I can see the three empty tables being created in the database.
The next minor problem is when entering the (C#) code of the sample: the "MyDatabaseDbContext" class doesn't exist, but a class named "MyDatabaseDbConnection" does exist (the same name used for the connection string in step 5). I assume that that is just a case of not all parts of the sample being consistent.
I can run the sample, but the results are not what I expected. A problem here is that the sample doesn't clearly state what should have been expected. What I observe is that whenever I run the sample a new row is inserted in the Regions and Students tables, but no row is inserted in the StudentsRegions table. Is that intended? It makes defining that relation table kindof pointless, isn't it?
Next I have one more question about the sample. How do I insert a second student in the same region without inserting a new region (in an independent execution, so emulating the case where the existing 'studentRegion' variable is not accessible for reuse). And related: what is the normal way to reference a new student to a region that may or may not exist in the databse yet - how do I get that region that may need to be created or may need to be retrieved?