none
Multiple ssdl support in the edmx format.

    Question

  • Hi All,

    I have a project in which we require support for multiple database backends.
    What we would like to do is have a single conceptual model (single csdl file) with multiple schema models (multiple ssdl files) for each database provider, e.g. SQL Server 2005, Oracle, etc. and a single mapping file (assuming column and table names are consistent).
    There is an example of this provided in the following code sample:
    http://code.msdn.microsoft.com/EFQuerySamples

    However, my question is... does the new edmx file format support this in anyway?
    Is it possible to place multiple storage models in the <edmx: StorageModels> section/element of the file? and if so how does the system know which one to use?
    (also if there any designer support for this, for example in the Model Browser?)

    Any help would be appreciated. I've found some limited information through searches of other posts but most is outdated and im curious if there is any new information on this subject.

    Thanks in advance

    Paul
    Monday, August 25, 2008 2:25 AM

Answers

  • No, the edmx file does not support this, nor does the designer.

     

    My suggestion is that you have a "definitive" edmx file that you use for mapping and modeling. Then maintain SSDL files for various databases  separately - e.g. by using EdmGen in your build system to reverse engineer the schemas of the target databases, and perhaps to run validation passes against the resulting CSDL/MSL/SSDL combinations.

     

    I'm not sure how you plan on doing connection string management, but solving that problem should be straightforward.

     

    HTH,

     Noam

    Monday, August 25, 2008 3:28 AM
    Moderator
  • There are no plans to include explicit support for this in the next release. That said, a number of upcoming features may make implementing this easier.

     

    For what it is worth, it is possible to implement this functionality right now using standard visual studio extensibility: You can add context menus to the designer and use them to switch the SSDL contents of the EDMX file. A number of folks have built tools for EDMX files that modify them in useful way - e.g. pluralization/naming modification.

    Monday, August 25, 2008 3:57 AM
    Moderator

All replies

  • No, the edmx file does not support this, nor does the designer.

     

    My suggestion is that you have a "definitive" edmx file that you use for mapping and modeling. Then maintain SSDL files for various databases  separately - e.g. by using EdmGen in your build system to reverse engineer the schemas of the target databases, and perhaps to run validation passes against the resulting CSDL/MSL/SSDL combinations.

     

    I'm not sure how you plan on doing connection string management, but solving that problem should be straightforward.

     

    HTH,

     Noam

    Monday, August 25, 2008 3:28 AM
    Moderator
  • Thanks for the reply and suggestions Noam.

    Are there any plans on including this support in future releases? and if so, roughly, when could we expect this?

    Thanks again

    Paul
    Monday, August 25, 2008 3:42 AM
  • There are no plans to include explicit support for this in the next release. That said, a number of upcoming features may make implementing this easier.

     

    For what it is worth, it is possible to implement this functionality right now using standard visual studio extensibility: You can add context menus to the designer and use them to switch the SSDL contents of the EDMX file. A number of folks have built tools for EDMX files that modify them in useful way - e.g. pluralization/naming modification.

    Monday, August 25, 2008 3:57 AM
    Moderator
  • There are no plans to include explicit support for this in the next release. That said, a number of upcoming features may make implementing this easier.

    Any news on this now (EF 6.1)? It's a long time since 2008 and many versions of EF have been released since then.

    eloekset

    Monday, October 10, 2016 11:17 AM