score:2

Accepted answer

what about this:

var range = mycontext.performanceranges
            .singleordefault(e=>e.lowthreshold <= score && e.highthreshold >= score)??
            performanceranges.single(
                                      e=>e.highthreshold == performanceranges
                                                            .max(p=> p.highthreshold)
                                    );

string evaluationtext = range.description;

the range query will select the element that matches with the thereshold ranges, and if the value is greater (the first query will return null), it will select the greatest range.

score:1

what about this:

  string evaluationtext = mycontext.performanceranges.where
                    (e =>
                          (e.lowthreshold <= score
                          &&
                          e.highthreshold >= score) || 
                         (e.highthreshold == 
                            mycontext.performanceranges.max (
                                  x => x.highthreshold) 
                            && score > e.highthreshold )
                    )
                    .select(eval => eval.description).first().tostring();

Related Query

More Query from same tag