none
Entity Framework designer with multiple schemas in db RRS feed

  • Question

  • I have a sql server database with tables sr.[Orders] and crp.[Orders] how can I work with these tables into the designer.  The entity designer strips off the schema names. You end up with Orders Orders1.  Should I just rename them all in the designer (e.g.crpOrders, srOrders)?

    Is there a better way?

     




    • Edited by chuck02323 Thursday, November 10, 2011 5:31 PM
    Thursday, November 10, 2011 4:59 PM

Answers

  • I didn't see any suggestions, other than the one I started with.
    Thursday, November 17, 2011 2:13 PM
  • If you use the out-of-the-box designer/tools then renaming them manually is the way to go.

     

    However, some 3rd party tools for EF can automate this task for you. Check out my add-in at http://huagati.com/edmxtools/ - it can automate renaming entities based on rules for existing models, and you can use the same rule definitions if generating a new model or when updating existing models.

    In this case, it sounds like the "fully qualified name" option is what you are looking for:

     

    You can download the add-in and get a trial license from the URL above if you want to try it out.


     
       Cool tools for Linq-to-SQL and Entity Framework 4:
     huagati.com/dbmltools - Visual Studio add-in with loads of new features for the Entity Framework and Linq-to-SQL designers
     huagati.com/L2SProfiler - Runtime SQL query profiler for Linq-to-SQL and Entity Framework v4

    Thursday, November 17, 2011 2:45 PM

All replies

  • Hi chunk,

    Welcome!

    You can just rename the Entities Name on the desiner and save, then you can use the name in you code.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, November 11, 2011 7:28 AM
    Moderator
  • Hi,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, November 17, 2011 2:08 AM
    Moderator
  • I didn't see any suggestions, other than the one I started with.
    Thursday, November 17, 2011 2:13 PM
  • If you use the out-of-the-box designer/tools then renaming them manually is the way to go.

     

    However, some 3rd party tools for EF can automate this task for you. Check out my add-in at http://huagati.com/edmxtools/ - it can automate renaming entities based on rules for existing models, and you can use the same rule definitions if generating a new model or when updating existing models.

    In this case, it sounds like the "fully qualified name" option is what you are looking for:

     

    You can download the add-in and get a trial license from the URL above if you want to try it out.


     
       Cool tools for Linq-to-SQL and Entity Framework 4:
     huagati.com/dbmltools - Visual Studio add-in with loads of new features for the Entity Framework and Linq-to-SQL designers
     huagati.com/L2SProfiler - Runtime SQL query profiler for Linq-to-SQL and Entity Framework v4

    Thursday, November 17, 2011 2:45 PM