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;
 }
Example #2
0
 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");
     }
 }
Example #3
0
 public HomeController(ICacheManagementFactory cacheManagementFactory)
 {
     this.cacheManagementFactory = cacheManagementFactory;
 }
Example #4
0
        public static ICacheManagement <CacheFormat> Get <CacheFormat>(this ICacheManagementFactory factory, string name)
        {
            ICacheManagement cache = factory.Get(name);

            return((ICacheManagement <CacheFormat>)cache);
        }
Example #5
0
        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());
        }