public UserProfileController(IGetCurrentUser getCurrentUser, IUserProfileService userProfileService, ILogger <UserProfileController> logger, ICacheManagementFactory cacheMgmtFactory, IReadOnlyPolicyRegistry <string> cachePolicyRegistry) { this.getCurrentUser = getCurrentUser; this.userProfileService = userProfileService; this.logger = logger; this.cacheMgmtFactory = cacheMgmtFactory; this.cachePolicyRegistry = cachePolicyRegistry; }
public static ICacheManagement Get(this ICacheManagementFactory factory, string name) { if (factory.TryGetValue(name, out ICacheManagement result)) { return(result); } else { throw new ArgumentException($"CacheManagement {name} is not registered"); } }
public HomeController(ICacheManagementFactory cacheManagementFactory) { this.cacheManagementFactory = cacheManagementFactory; }
public static ICacheManagement <CacheFormat> Get <CacheFormat>(this ICacheManagementFactory factory, string name) { ICacheManagement cache = factory.Get(name); return((ICacheManagement <CacheFormat>)cache); }
public static void Evict(this ICacheManagementFactory factory, string cacheName, params string[] keys) { var mgmt = factory.Get(cacheName); mgmt.Evict(keys.Select(args => new Context(args)).ToArray()); }