I am trying to query a collection of records using a ">=" for a string column/member.
What I want/am expecting is that such a condition would, given the following values in the "musician" member:
Clarence "Gatemouth" Brown
Merle Travis
Eddie Van Halen
Rory Gallagher
Elvin Bishop
Eric Clapton
Jimi Hendrix
Stevie Ray Vaughan
Robin Trower
Ritchie Blackmore
Carlos Santana
Mark Knopfler
Pete Anderson
...and the following LINQ query:
private readonly List<Musician> musicians = new List<Musician>();
. . .
public IEnumerable<Musician> Get(string musician)
{
IEnumerable<Musician> Musicians = from m in musicians
where m.musician >= musician
select m;
. . .
...with "Robin" passed as the "musician" arg, return an IEnumerbale collection of Musician containing those records with a musician value of:
Robin Trower
Rory Gallagher
Stevie Ray Vaughan
(IOW, anything "greater than" Robin, such as what would appear from "Robin" onwards if using an "ORDER BY MUSICIAN" clause in a SQL query).
Instead of that working as expected, though, it doesn't even compile, and I get, "Operator '>=' cannot be applied to operands of type 'string' and 'string'" on the "where m.musician >= musician" portion of the LINQ query.
So how can I use LINQ to filter a collection of "records" by a string value?