示例#1
0
 private static SyndicationFeedFormatter SetCache(Arguments arguments, SyndicationFeedFormatter formattedFeed)
 {
     MemoryCache.Default.Add(
         new CacheItem(arguments.ToString(), formattedFeed),
         new CacheItemPolicy {
         AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(1)
     });
     return(formattedFeed);
 }
示例#2
0
 private static SyndicationFeedFormatter GetFromCache(Arguments arguments) =>
 MemoryCache.Default.Get(arguments.ToString()) as SyndicationFeedFormatter;