score:2

Accepted answer

Changed this

dynamicQueryBase.Add("other[\"" + field + "\"]" + " = @" + validFieldCount++);

to this

dynamicQueryBase.Add("other[\"" + field + "\"].ToString()" + " = @" + validFieldCount++);

makes it work as expected.

score:0

I can't test right now, maybe the default return for "where" is only a single item.
Try

var results = originalLineItems.Where(dynamicWhere, distinctResult).ToList();

And check if it's working fine.


Related Articles