Try this sample code:
using System;
using System.Collections.Generic;
using System.Linq;
public class SomeClass
{
public string name { get; set; }
public int strRecPriority { get; set; }
public SomeClass(string name, int strRecPriority)
{
this.name = name;
this.strRecPriority = strRecPriority;
}
}
public class Program
{
public static void Main()
{
List<SomeClass> list = new List<SomeClass>();
list.Add(new SomeClass("Apple", 100));
list.Add(new SomeClass("Banana", 50));
list.Add(new SomeClass("Orange", 97));
list.Add(new SomeClass("Pear", 110));
list.Add(new SomeClass("Strwberry", 88));
var result1 = list.OrderByDescending(a => a.strRecPriority).ToList<SomeClass>();
foreach (SomeClass o in result1)
{
Console.WriteLine(o.name + " " + o.strRecPriority);
}
}
}