Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Config"/> class.
        /// </summary>
        /// <param name="cachingFactory">The caching factory.</param>
        /// <param name="authService">The authentication service.</param>
        public Config(ICachingRegionFactory cachingFactory, IAuthenticationService authService)
        {
            this.authService = authService;
            this.account     = cachingFactory.CreateRegion <AccountModel>("config");

            this.authService.AuthChanged += this.SaveAuthState;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShoppingCartService"/> class.
        /// </summary>
        /// <param name="cachingRegionFactory">The caching region factory.</param>
        /// <exception cref="ArgumentNullException"></exception>
        public ShoppingCartService(ICachingRegionFactory cachingRegionFactory)
        {
            if (cachingRegionFactory == null)
            {
                throw new ArgumentNullException(nameof(cachingRegionFactory));
            }
            this.cachingRegion = cachingRegionFactory.CreateRegion <IEnumerable <CartItemModel> >("ShoppingCart");

            this.LoadItems();
        }
Beispiel #3
0
 public CachingService(ICacheMangerFactory cacheMangerFactory, ICachingRegion cachingRegion)
 {
     _cacheMangerFactory = cacheMangerFactory;
     _region             = cachingRegion.Region;
 }