Body
Think about it or write it, although the knowledge content is lower ....
Get the data into the cache, and add the result of their own with add is always reported parameter error, I wipe, I still feel is entrusted to the problem.
Call. Invoke ("Key", O, cacheitemremovedreason.removed);
System.Web.Caching.CacheItemRemovedCallback call = new System.Web.Caching.CacheItemRemovedCallback (Callback);
HTTPRUNTIME.CACHE.ADD ("I", o,null,datetime.now,20000, System.web.caching.cacheitempriority.default,call);
The problem arose, looking at the commission for a long while, still did not understand. In the final analysis of the delegation is not enough to understand, and finally looked at the use of the delegate, found that their usage is not a problem. Finally, you have to check the usage of Add.
HTTPRUNTIME.CACHE.ADD ("Key", O, NULL, DateTime.Now.AddSeconds (), TimeSpan.Zero, Cacheitempriority.high, call);
callback function no problem, just the time stamp problem, people are timespan type, I directly understand to write a number is OK. So this parameter is changed and there is no problem.
The point is actually to say is the meaning of the delegate, what is the delegate, define a delegate in fact, define a function variable, it can be easier to understand, when we put this delegate specific point to a specific method, in fact, is for the variable assignment process. If the delegate is not a parameter, then it can be called directly with just one curly brace. If it is a parameter, then it is OK to pass the variable name directly over it, as in the example above. I do not know whether to say that it is clear .... Welcome to the Great God of all directions
The delegate explanation of the cache's add