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

2023-09-04 09:55:31 作者:冷劍℡

我正与实体框架。我使用一个单一的数据库,多个模式为, mySchema1.Employee mySchema2.Employee mySchema3.Employee

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

当我生成EDMX该数据库,它重命名表作为Employee1,和Employee2,Employee3等。

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

如何实现多种模式的实施,单EDMX。

How to achieve multiple schemas implementation with single edmx.

编辑: 该对象应该由这里员工相同的名字叫。只有可变部分是架构。 ctx.Employee - 应该从一个特定的模式获取数据。我在寻找的东西在那里我可以指定要使用的。

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.

请帮忙。

推荐答案

我不知道我是否理解这个问题......你想拥有的每个模型多个图表?

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

此功能在实体框架5这是最近发布的补充。请确保您使用的是最新版本。

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