Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Google Guava在 C# 中的LoadingCache是否有替代方案?
.Net 语言功能和外部 dll 可以做到。
该类MemoryCache是一种选择 - http://msdn.microsoft.com/en-us/library/system.runtime.caching.memorycache.aspx
MemoryCache
您可以设置过期策略和内存限制,我不确定它是否包含 LoadingCache 的所有功能,但它可能很接近。
您还可以使用 postsharp 缓存。
样品在这里。