The title is perhaps a little confusing (please change if it is)
I have a list of objects, example is:
public class MyObj{
public int ID {get;set;}
public string MyType {get;set;}
}
Let's say I have a List<MyObj>
that contains 4 elements.
The types on each of these are:
myObj1.MyType = "ABC";
myObj2.MyType = "7551";
myObj3.MyType = "AAABB";
myObj3.MyType = "CDE";
I would like to, if possible, order this list so that "ABC"
has the most weight and comes first. The rest of the list can be sorted alphabetically.
I'm in .Net 4.5 so can use the Comparer<>.Create()
- i just have no idea how to do what I need to do.