如何:实体框架和多个模式

时间:2022-03-29 09:21:38

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

我正在使用实体框架。我正在使用一个具有多个模式的数据库mySchema1。员工mySchema2。员工mySchema3.Employee

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

当我为这个数据库生成edmx时,它将表重命名为Employee1、Employee2、Employee3等。

How to achieve multiple schemas implementation with single edmx.

如何使用单一的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.

编辑:对象在这里应该以与Employee相同的名称进行调用。只有可变部分是模式。ctx。Employee——应该从特定的模式获取数据。我正在寻找可以指定使用哪个的东西。

Please help.

请帮助。

1 个解决方案

#1


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.

这个特性被添加到最近发布的Entity Framework 5中。确保您正在使用最新的版本。

#1


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.

这个特性被添加到最近发布的Entity Framework 5中。确保您正在使用最新的版本。