如何:实体框架和多个模式 [英] How To : Entity framework and multiple schemas

查看:146
本文介绍了如何:实体框架和多个模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正与实体框架。我使用一个单一的数据库,多个模式为, 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.

这篇关于如何:实体框架和多个模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆