c# - LINQ find records that are different in two separate tables -


i have 2 tables identical. 1 live data , other staging data.

they both have same unique key constraint on 2 columns.

using linq, possible list of records in production differ in staging?

the table looks this:

string name string number timespan timein timespan timeout . snip . string lastday 

like said, both tables identical , want records columns [after] name , number differ same record in production table assuming name , number comprise primary key.

edit

is long query && , !='s?

use linq join , where clauses in combination - this:

from s in staging join p in production on new {s.name, s.number} equals new {p.name, p.number} s.timein != p.timein || s.timeout != p.timeout || s.lastday != p.lastday select s 

i have included columns showed after name , number of course - not snipped, idea.

the c# programming guide has more information on joining using composite keys.


Comments