Sort List by occurrence of a word by LINQ C#
- by Thomas
i have stored data in list like
List<SearchResult> list = new List<SearchResult>();
SearchResult sr = new SearchResult();
sr.Description = "sample description";
list.Add(sr);
suppose my data is stored in description field like
"JCB Excavator - ECU P/N: 728/35700"
"Geo Prism 1995 - ABS #16213899"
"Geo Prism 1995 - ABS #16213899"
"Geo Prism 1995 - ABS #16213899"
"Wie man BBA reman erreicht"
"this test JCB"
"Ersatz Airbags, Gurtstrammer und Auto Körper Teile"
now i want to query the list with my search term like geo jcb
if you look then the word geo has stored many times in the description field. so i want to sort my list in such way that the word in search term found maximum that data will come first. please help me to do so. thanks