5

I am working with Entity framework. I am using a single database with multiple schemas as, mySchema1.Employee
mySchema2.Employee
mySchema3.Employee

When I generate edmx for this database, it renames the tables as Employee1, Employee2, Employee3 etc.

How to achieve multiple schemas implementation with single edmx.

Edit: The objects should be called by same name here as Employee. Only the variable part is schema. ctx.Employee - should fetch data from a specific schema. I am looking for something where I can specify which to be used.

Please help.

VJOY
  • 3,752
  • 12
  • 57
  • 90
  • What do you *want* it to call the objects it creates? – AakashM Aug 21 '12 at 09:55
  • Do you want them all be called Employee? Can you state your intentions (what you would like to achieve) a little bit more? – Styxxy Aug 21 '12 at 09:55
  • @Styxxy - Please find edited part of question. – VJOY Aug 21 '12 at 10:38
  • So you want to be able to specify whether to use `mySchema1.Employee` or `mySchema2.Employee` - do you mean you want to be able to choose at *run time*? Or when you are generating the edmx? – AakashM Aug 21 '12 at 10:46
  • Either ways will do. Right now when I generate edmx it creates 3 different tables with different names. – VJOY Aug 21 '12 at 11:44
  • 2
    did you solve this? I need the exact same thing! thanks! – Nicole Jul 08 '13 at 18:21

1 Answers1

1

I'm not sure whether I understand the question... Do you want to have multiple diagrams per model ?

This feature is added in Entity Framework 5 which was recently released. Make sure you're using the latest version.

Madushan
  • 6,977
  • 31
  • 79