MSSQL + Oracle
MSSQL + Oracle
Does anyone have a good strategy for creating one entity framework that supports customers on Oracle or MS SQL?
Thanks
Thanks
You can refer to our EFQuerySamples. They are available here:
http://devart.com/dotconnect/efquerysamples.zip
These samples use the same CSDL and MSL and differ only in the SSDL part of .edmx file. You can design your model in similar way,
having identical CSDL and MSL layers and the provider-specific SSDL layer.
http://devart.com/dotconnect/efquerysamples.zip
These samples use the same CSDL and MSL and differ only in the SSDL part of .edmx file. You can design your model in similar way,
having identical CSDL and MSL layers and the provider-specific SSDL layer.
These CSDL, MSL and SSDL, you generate them with Entity Developer from Devart?
Any sugestion for the source database from where you generate your .cs? Asking this because of different mapping of types in Oracle and SQLServer.
In any way (futurely) will you make it possible to change the model from Oracle to SQL Server without have to make a new model based on SQL Server? Like, I change the connection and the model "refresh". Off course we map the same tables in both sql server and oracle.
Any sugestion for the source database from where you generate your .cs? Asking this because of different mapping of types in Oracle and SQLServer.
In any way (futurely) will you make it possible to change the model from Oracle to SQL Server without have to make a new model based on SQL Server? Like, I change the connection and the model "refresh". Off course we map the same tables in both sql server and oracle.
Can we store SSLDs as 'embedded resource'
The samples save these SSDLs in the 'Schemas\ folder. Is it possible to keep them as 'Embedded Resources' instead?
exception while using Embedded Resource
when I do that I get an exception.
EXCEPTION (System.Data.MetadataException): Unable to load the specified metadata resource
EXCEPTION (System.Data.MetadataException): Unable to load the specified metadata resource
Please change the entity connection string to point on the generated resources, like this:
and check that the names of the resources embedded into your assembly coincide with the names
you have written in your connection string.
Code: Select all
metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...
you have written in your connection string.
overriding the SSDL
this works fine. But the error shows up when I override the SSDL with a diff. name. For example...
metadata=res://*/Model1.csdl|res://*/Model2.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...
however, if I use it as a file instead of embedded resource it works. For example...
metadata=res://*/Model1.csdl|Model2.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...
metadata=res://*/Model1.csdl|res://*/Model2.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...
however, if I use it as a file instead of embedded resource it works. For example...
metadata=res://*/Model1.csdl|Model2.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...
Please note that Entity Framework may generate a resource with a name that differs from the model name.
To check the name generated, simply view the generated assembly using any tool that enables resource
viewing, for example .NET Reflector.
Also please check that the Build Action for the Model2.ssdl file is set to Embedded Resource.
To check the name generated, simply view the generated assembly using any tool that enables resource
viewing, for example .NET Reflector.
Also please check that the Build Action for the Model2.ssdl file is set to Embedded Resource.
entity name has the assembly ns too
you are right. visual studio added the assembly namespace also. Is there a way to tell VS not to do that? btw, it does not do that for the components within the EDMX file. I am guessing that's because of the 'EntityDeploy' custom action.