0

Currently to find a specific value I do:

MyClass myclass = MyObservableList.FirstOrDefault(x => x.value == 5.54m);

However I want to be able to set a margin, instead of just looking for 5.54m, I want it to be a range of 5.53-5.55. Is there an easy way of doing that?

Enigmativity
  • 113,464
  • 11
  • 89
  • 172

1 Answers1

1

Try this:

MyClass myclass =
    MyObservableList
        .Where(x => x.value >= 5.53m)
        .Where(x => x.value < 5.55m)
        .FirstOrDefault();
Enigmativity
  • 113,464
  • 11
  • 89
  • 172