I\'m trying to create an \"ordered\" cache of objects in C#, where the order is determined by how many times that has been accessed.
I\'ve looked into Dictionary, Sorted
The "Proper" way to do this is to implement IComparable (http://msdn.microsoft.com/en-us/library/system.icomparable.aspx) Interface in your MyCache Class.
This will expose a method called CompareTo which you will have to write in your code.
You would just create that method and put some logic in there that says if this object is greater, less than or equal to the object passed in.
Then you use it in your client code by saying int result = MyCache1.ComparTo(MyCache2);
The result will be -1 0 or 1 based on if its greater than less than or equal too.