views:

260

answers:

2

Is it possible to create an 'Entity' that will be an abstraction of a relationship between tables that live in two different tables, in two different databases, on two different machines, and even possibly using two different dbms?

For example, if I have a SQL Server db on one machine that stores all my customers, and I have an Oracle db on a different machine that stores all my orders, is it possible to wrap this in an entity and then use the entity in a LINQ expression as if they were together?

Thanks!

A: 

You can use multiple dbml files with different namespace for each file (like Myproject.Data.Customer,Myproject.Data.Orders etc..).

I think is this manner you can use multiple databases residing on different machines. using different namespaces for different dbs provide very good isolation, it will helps you to keep each db layer separate and you can have separate person/team working on each layer independently.

You can put all these in single layers/namespace, but that will be make things more complicated and difficult to maintain.

Sharique
+1  A: 

Wow, that would be the ultimate n-Tier solution!

Not as far as I know. Unless you create a view and bind EF to the view, but then it would be read-only (obviously)?

Program.X