I have two generic collections named barcodesSource and barcodesTarget. Both of them are the same type Helper. I want to compare collection named barcodesSource with second one collection base upon property BARCODE and return only data from first collection, which havent corresponding BARCODE in second collection.
Can any one tell me a solution of this?
class Helper
{
public long BARCODE { get; set; }
public int ITEM { get; set; }
}
List<Helper> barcodesSource = new List<Helper>();
List<Helper> barcodesTarget = new List<Helper>();
var distinctBarcodes = barcodesSource.Where(a => barcodesTarget.All(b => b.BARCODE != a.BARCODE));