score:1

var test2notintest1 = listoferrors.where(e => !listoftasks.any(t => t.id == e.id && t.occurrence == e.occurrence)).tolist();

score:1

var test2notintest1 = test2.where(t2 => !test1.any(t1 => t1.id == t2.id && t1.occurance == t2.occurance);

score:1

var test2notintest1 = test1.except(test2, new errorscomparer()); 


class errorscomparer : iequalitycomparer<errors>
{
    public bool equals(errors x, errors y)
    {
        //check whether the compared objects reference the same data.
        if (object.referenceequals(x, y)) return true;

        //check whether any of the compared objects is null.
        if (object.referenceequals(x, null) || object.referenceequals(y, null))
            return false;

        //check whether the products' properties are equal.
        return x.id == y.id && x.occurrence == y.occurrence;
    }

    // if equals() returns true for a pair of objects 
    // then gethashcode() must return the same value for these objects.
    public int gethashcode(errors e)
    {
        if (object.referenceequals(e, null)) return 0;

        int hashid = e.id == null ? 0 : e.id.gethashcode();
        int hasho = e.occurrence.gethashcode();

        //calculate the hash code for the product.
        return hashid ^ hasho;
    }
}

score:1

var notassignederrors = errors.notassignedin(tasks);

Related Query