Single entity model with sql server and oracle RRS feed

  • General discussion

  • HI,

    We are developing a product which supports mulitple database like SQL Server and Oracle. How to develop this using entity framwork with both the databases pointing to same entity model.


    Wednesday, July 24, 2013 10:30 AM

All replies

  • Hi Vaibhav,

    I'm afraid it is not supported for entity model. Here are some detailed information in this thread.

    Best regards,

    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Monday, July 29, 2013 5:37 AM
  • You can't do this. The only thing you can really do here is use Data Transfer Objects layer, which would be an abstraction layer away from the model. You are going to have two models but the application would be abstracted from the models.

    The other thing you can do is write your own "object code generator" that creates the DTO(s), creates CRUD operation methods for create, read, update and delete  for a given table based on the "object generator" reading the table schema of a SQL Server or Oracle table to create the necessary T-SQL or P-SQL.  What you are really doing with an "object code generator" is creating your own models. You would be using bound parameters in the code for T-SQL or P-SQL queries.

    Tuesday, July 30, 2013 10:21 AM