I have an array of unknown (to the current method) class objects. I do know that each class has a property called "Number". I am trying to write a LINQ query where I am looking for the object with the next Number in sequence. AKA, I'm at Number 8, use a LINQ query to find the object where Number=9.
Anyone got a suggestion?
Also, I use reflection often so don't worry about avoiding it.
You can create an interface - INumber with a property Number. Each of the objects that you are having in the array can implemen this interface.
That way, you will have an array of known type INumber. This way your query will be easy to debug and maintain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With