/// <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; }
/// <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(); }