If we select Metadata Artifact Processing = "Embed In Output Assembly" then we find the following files in the \obj\Debug folder:
Folder1.Model1.csdl
Folder1.Model1.msl
Folder1.Model1.ssdl
So the correct connection string would be something like this:
Code: Select all
(..)metadata=res://*/Folder1.Model1.csdl|res://*/Folder1.Model1.ssdl|res://*/Folder1.Model1.msl;(..)
With the dbcontext Template and "Save connection string in App.Config" = false the connection string in the context file constructor now is
Code: Select all
(..)metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;(..)
The second question would be: How do we get the "Folder1" part (seems to be the complete folder path to the model in the project) in the dbcontext template? We have to customize the context file generation, because we want to have one single connection string in the App.Config. So we must add the metadata to this string for each context. Our code already works if all models are in the project root.
For better performance the res://*/ should be replaced with the res://MyDefaultNamespace/, is that right?