The first Step to use the cache

Although it is acceptable to use a simple type, such as string, long as a key of the cache, it is recommended to define class for the key to identify the cahe.

class SomeKey :IEquatable<SomeKey>
    public long ID{get;set;}
    public bool Equals(SomeKey other)
        return ID == other.ID;

The benifit of this kind of key is that it is strong typed, having a definite scope and accurate meaning in key-value 

About the reset filter

Last edited Sep 23, 2011 at 2:55 PM by czy, version 8


No comments yet.