使用两个EntitiesModel以拥有两个不同的数据库 [英] Using two EntitiesModels in order to have two different databases
问题描述
我的项目中需要有两个数据库(我使用的是Sql compact edition)。所以我需要使用Telerik数据访问创建两个EntitiesModel,对吧?我想知道以下哪种方法更好:
1.在与类和其他文件相同的项目中添加EntitesModel.rlinq文件在它里面。
2.创建一个新项目并在那里添加EntitesModel.rlinq文件并使用主项目中的.dll文件来操作数据。
谢谢
Hi,
I need to have two databases in my project (I'm using Sql compact edition). So I need to create two EntitiesModels using Telerik data access, right? I want to know that which of the following ways is better to do it:
1. Adding both EntitesModel.rlinq files in the same project as the classes and other files are in it.
2. Creating a new project and adding EntitesModel.rlinq files there and using the .dll files in the main project in order to manipulating data.
Thank you
推荐答案
因为您正在访问两个数据库,我建议您使用每个实体实体模型及其类(以及可能的部分类) ),在它自己的程序集/项目(DLL)中,所以你将有2个DLL用于访问数据库。
PS:使用Telerik不是强制性的数据访问(您可以使用Microsoft EF),只有当您的应用程序UI基于Telerik时才必须使用它。
Because you are accessing two databases I suggest you that each entity entity model, together with its classes (and possible partial classes), to be in its own assembly/project (DLL), so you will have 2 DLL for accessing the databases.
PS: It is not mandatory to use Telerik data access (you could use Microsoft EF), you have to use it only if your application UI is based on Telerik.
这篇关于使用两个EntitiesModel以拥有两个不同的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!