コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasketServiceController" /> class.
        /// </summary>
        /// <param name="productRepositoryLocator">The repository locator.</param>
        /// <param name="sessionManager">The session manager.</param>
        public BasketServiceController(IProductRepositoryLocator productRepositoryLocator, ISessionManager sessionManager)
        {
            Guard.ArgumentNotNull(productRepositoryLocator, "productRepositoryLocator");
            Guard.ArgumentNotNull(sessionManager, "sessionManager");

            this.productRepositoryLocator = productRepositoryLocator;
            this.sessionManager = sessionManager;
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasketServiceController" /> class.
        /// </summary>
        /// <param name="productRepositoryLocator">The repository locator.</param>
        /// <param name="sessionManager">The session manager.</param>
        /// <param name="productLocatorService">The product locator service.</param>
        public BasketServiceController(IProductRepositoryLocator productRepositoryLocator, ISessionManager sessionManager, ProductLocatorService productLocatorService)
        {
            Guard.ArgumentNotNull(productRepositoryLocator, "productRepositoryLocator");
            Guard.ArgumentNotNull(sessionManager, "sessionManager");
            Guard.ArgumentNotNull(productLocatorService, "productLocatorService");

            this.productRepositoryLocator = productRepositoryLocator;
            this.sessionManager           = sessionManager;
            this.productLocatorService    = productLocatorService;
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProductLocatorService" /> class.
 /// </summary>
 /// <param name="productRepositoryLocator">The product locator.</param>
 public ProductLocatorService(IProductRepositoryLocator productRepositoryLocator)
 {
     this.productJumpTable.Add(typeof(Book).Name, productRepositoryLocator.BookRepository.FetchById);
     this.productJumpTable.Add(typeof(Movie).Name, productRepositoryLocator.MovieRepository.FetchById);
 }