Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Thing {
- public string Name { get; set; }
- public DateTime EditDate { get; set; }
- }
- var things = new List<Thing>();
- thing.Sort((t1, t2) => t1.EditDate.CompareTo(t2.EditDate));
- things.Sort((t1, t2) =>
- {
- if (t1 == null)
- {
- return (t2 == null) ? 0 : -1;
- }
- if (t2 == null)
- {
- return 1;
- }
- return t1.EditDate.CompareTo(t2.EditDate);
- });
- TheList.Sort(int delegate(Type a, Type b)
- {
- if (a.memeber == null) return -1;
- if (b.memeber == null) return 1;
- if (a.memeber<b.memeber) return -1;
- if (b.memeber<a.memeber) return 1;
- return 0;
- }
Add Comment
Please, Sign In to add comment