May 20, 2010 09:06 AM|chilluk|LINK
OK I have the basics of the setup - I have the overall class which also contains a collection of the class that represents the items. I have also been able to bind this to my repeater and all is well so far.
Now though I need to "query" my collection - is this where I really need to look at LINQ?
For example I may have say 5 items in my basket (collection) - I would like to know if between them 1 or more has a certain value in a certain column - e.g. one of my columns is an age rating, so I'd like to know if the basket as a whole requires confirmation
that the customer is over 18 (we sell sharp stuff!) - so if 1 or more items has an appropriate value in this column, the basket as a whole can be deemed to need authorisation.
I know I could iterate across all items but I have 2 or 3 similar checks to do and I don't want to repeat the process. Ideally I'd like to have a property (function?) on my main basket class that just returns AgeWarning = True (or false of course!)
Would the BinarySearch or Find type methods be soemthing I should look at? They seem more geared to obtaining specific rows within the collection though?
Re the hungarian notation - borne out of my VB / VBA days - 18 years served man and boy!