I have an event receiver that lsitenes on an "added" event. Inside that receiver I have to retrieve all contents of another list:
var refList=Web.Lists.TryGetList("ReferenceData");
var allItems=refList.GetItems();
foreach( var item in allItems) {
// stuff here
}
If I do this on the ItemAdded
-Event each time I have to retrieve all data from the reference list. Because the data in the reference list does not change very often I would prefer to Cache the content and only refresh it once every day. Usually I would try HttpContext.Cache
, but I do not seem to have a httpContext
in an added receiver.
What is the best way to do this?