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?
CodePudding user response:
Try this:
MyClass myclass =
MyObservableList
.Where(x => x.value >= 5.53m)
.Where(x => x.value < 5.55m)
.FirstOrDefault();