I'm kind of new to LINQ, so please cut me the slack.
I have a LINQ statement into which I have grouped several columns. Depending on the search, he evaluates each record as it matches the search.
- 1 pt. for the first letter on behalf
- 2 pts. for the first 2 letters of the name
- 4 points to match the name
- 8 points. for name matching
So the first order is this. Then I want the Thenby operator to be ordered by FirstName
var ResultsListOrdered = from O in ResultsList group O by new { O.FirstName, O.LastName, O.SSN, O.Email, O.Phone } into g orderby g.Max().ResultMatch descending thenby g.Key.FirstName ascending select new SearchResultViewModel { ID = g.Max().ID, FirstName = ti.ToTitleCase(g.Key.FirstName.ToLower()), LastName = ti.ToTitleCase(g.Key.LastName.ToLower()), SSN = g.Key.SSN, Email = g.Key.Email.ToLower(), Phone = g.Key.Phone, ResultMatch = g.Max().ResultMatch };`
if the LINQ statement works, if you take out the thenby string. But once you put it on it, it wonβt work.
That should work. Any help would be great
here is the mistake he shows me when I hung over him

OK I AM ADD THIS HERE FOR COMMENTS BELOW THE SUBSIDIARY THAT I CAN'T ADD AN IMAGE TO THE COMMENT


source share