using (var db1 = new DataBase1Entities())
{
using (var db2 = new DataBase2Entities())
{
var list = (from obj in db2.Table1
where !db1.Table2.Any(i => i.Table2Col == obj.Table1Col)
select obj).ToList();
}
}
does anyone know how to retrieve value from one database table and compare it with another database table ? If the above code is correct, then will it cause performance issue ?
usingis common pattern to use multipleIDisposables.usingbut resource allocation/freeing that affect the performance; another resource consuming process is the code insideusing- "code to retrieve data from db1 and compare it with db2""affect performance" relative to whatBased on the context, presumably compared to not using nested using. i.e. have the secondusingoutside of the first.db1? Or: which ORM is this? For the rest: race your horses.