new ConcurrentDictionary <string, object>(); /*Use SYNCHRONIZED for cross thread blocks*/ public object GetFolderTrash(IFolderDao folderDao) { if (IsOutsider) { return(null); } var cacheKey = string.Format("trash/{0}/{1}", TenantManager.GetCurrentTenant().TenantId, AuthContext.CurrentAccount.ID); if (!TrashFolderCache.TryGetValue(cacheKey, out var trashFolderId)) { trashFolderId = AuthContext.IsAuthenticated ? folderDao.GetFolderIDTrash(true) : 0; TrashFolderCache[cacheKey] = trashFolderId; } return(trashFolderId); }