I have list of object. I'm trying to sort it using one of the property.
I'm trying something like below:
items.OrderBy(x => x.Name).ToList()
items can contain values for Name like follows :
case 1 - abc,xyz,byc,myu
case 2 - abc3,xur2,iuy7
I want to sort list in descending order if any values contain int (numbers). So here in case 2, i want to sort in descending order. In case 1,sorting will be in ascending order. The question is how to identify whether list contains any integers or not? So that i can decide the ordering.
public class TestClass
{
public string ID { get; set; }
public string Name { get; set; }
public string Address { get; set; }
}