Using the Lambda notation for clarity, it breaks down into several functions in sequence as follows:
IEnumerable<Int32> DistinctIds = TagTable.Where(x => searchTerms.Contains(x.Label)).Select( x => x.AuctionId).Distinct()
Without going too far into lambda syntax, the main functions are here:
.Where (x => searchTerms.Contains (x.Label)) - this will only select rows in which the searchTerms collection contains the Label value for this row
.Select (x => x.AuctionId) - return only the integer values โโAutionId, not the full record
.Distinct () - does what it says on the prong
Hope this helps
Markmiddlemist
source share