0
Answer

Wrapping a Predicate

Ask a question
Neville

Neville

15y
2.1k
1

Hello,

I want to wrap a predicate search function to make my code more readable.  I have the following, which functionally works just fine:

InstrumentArray[InstrumentArray.FindIndex(delegate(Instrument i) { return i.Name == "1234v1"; })].Name = "1234v2";

InstrumentArray is a List<Instrument>

Is there a way for me to do the following?

InstrumentArray.GetInstrument(Name == "1234v1").Name = "1234v2";

Thanks,

Neville