I am writing code that will select string keys from an ApiIds array that are not ApiId properties of the result objects.
I wrote the following code, but it looks superfluous for me, is there a way to combine it into one statement and not convert HashSet objects to another HashSet of strings?
var resultsCached = new HashSet<string>(results.Select(x => x.ApiId));
var missingResults = apiIds.Select(x => !resultsCached.Contains(x));
Thank.
source
share