We have a simple table for the Type Entity Framework 4.0 model: -

- ALl classes are all POCO.
- Class post
abstract . Discussion and List are concretes classes that inherit from Posts (as shown in the diagram).
When we try to keep Discussion , we do the following code: -
Posts.AddObject(discussion);
And the Sql Server syntax consists of two parts. The second mistake. Pay attention to sql schema namespace? Why is this? (Code taken from EFProf )
insert [dbo].[Posts] ([Subject], [UniqueSubject], [Content], [CreatedOn], [ModifiedOn], [IsVisible], [UserId]) values('Test Subject' , 'sdfsdfsdfsdfsfdssd' , 'this is a lot of content - pew pew pew' , '23/09/2010 12:22:08 PM +10:00' , '23/09/2010 12:22:08 PM +10:00' , 1 , 1 ) select [PostId] from [dbo].[Posts] where @@ROWCOUNT > 0 and [PostId] = scope_identity() insert [XWingModelStoreContainer].[Discussions] ([PostId]) values(20132 )
Note that the table name is [XWingModelStoreContainer]. [Discussions] ?? It should not be [dbo]. [Discussions] ?? How can we fix this, please?
.
.
UPDATE:
In addition, here is another snapshot of our designerβs properties .. so you can see that we thought he should call [dbo], since this is the default Database Scheme Name ..

and in the Xml file edmx .. there are two lines of name.d.
<edmx:StorageModels> <Schema Namespace="XWingModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com.. snip ..." xmlns="http://schemas.microsoft.com/ ..snip .."> <EntityContainer Name="XWingModelStoreContainer"> .....
and..
<edmx:Mappings> <Mapping xmlns="http://schemas.microsoft.c.. snip .." Space="CS"> <Alias Key="Model" Value="XWingModel" /> <Alias Key="Target" Value="XWingModel.Store" /> <EntityContainerMapping CdmEntityContainer="XWingEntities" StorageEntityContainer="XWingModelStoreContainer"> .......
Does it help? I have no idea how these names got (I assume auto-generation) and how do I need to change them? If so, it seems that this is only possible through an XML file .. this is normal .. but it feels ... wrong?
Greetings :)