I need to define a static property or method in specific classes of my business logic to find out which classes are cached in an ASP.NET service session or cache. I think a static property or method in an interface would be ideal, but C # 4.0 does not support this.
All that is needed is to evaluate in the universal manager which classes are cacheable, and if they exist, at what level: session (user) or cache (application).
Now I am trying with an empty interface with a parameter T to evaluate, but maybe there is a better approach? Thanks.
public interface ICacheable<T> { } public class Country : ICacheable<CacheApplication> { } public class Department : ICacheable<CacheUser> { } public class Gestor<T> {
source share