Sql – Best practice creating LINQ-to-SQL classes to deal with the same entity present in 10 different data sources

.net-3.5ado.netentity-frameworklinq-to-sql

I was wondering what would be the best way to create LINQ-to-SQL classes to deal with a given entity which is present in 10 different data sources. Let's say I've got the same database in 10 different countries, each of them with a Customers table, and my goal is to access all of them programatically. Should I either create:

  1. a single ADO.NET Data Model then try
    to combine everything there;

  2. as many LINQ-to-SQL classes as
    existing data sources;

  3. a single LINQ-to-SQL class mapping a
    single data source, then
    manipulating its connection string.

Your feedback will be really appreciated. Thanks everyone for your comments!

Best Answer

The first and the third options are practically equal, the thing that matters is your preference.
If you don't have schemas with the same name in all your data sources, you will have to make some manual changes to the model in any of these two cases.
In EF you'll have to remove the Schema attribute using XML Editor.
In LINQ to SQL, you'll have to remove the schema name prefix from the Source property in designer.