Reputation: 17196
I would like to obtain records from two sources (i.e. 2 different connection strings) with identical model to storage mappings.
Something more-or-less like:
var db = new MyModel(connectionString1);
var set1 = db.Things;
db = new MyModel(connectionString2);
set1.Merge(db.Things);
Is this possible?
Upvotes: 0
Views: 695
Reputation: 43748
Do you mean that you want all of the 'Things' from both DBs in 1 list? If so, you can just use the Union()
method I believe:
Change the last line to:
var allThings = set1.Union(db.Things);
Upvotes: 3