コード例 #1
0
 public OrderController(IOrderService orderService, IShopCartService shopCartService,
                        ShopCart shopCart)
 {
     this.orderService    = orderService;
     this.shopCartService = shopCartService;
     this.shopCart        = shopCart;
 }
コード例 #2
0
 public ShopCartController(IShopCartService shopCartService, ICatalogService catalogService,
                           IOrderService orderService)
 {
     _shopCartService = shopCartService;
     _catalogService  = catalogService;
     _orderService    = orderService;
 }
コード例 #3
0
        public void ConfigureServices(IServiceCollection services)
        {
            var connectionString = configuration.GetConnectionString("DefaultConnection");

            services.AddDbContext <ShopContext>(options => options.UseSqlServer(connectionString));

            services.AddScoped <IUnitOfWork, UnitOfWork>();

            services.AddScoped <IOrderService, OrderService>();
            services.AddScoped <ICarService, CarService>();
            services.AddScoped <ICategoryService, CategoryService>();

            services.AddScoped <IOrderRepository, OrderRepository>();
            services.AddScoped <IShopCartItemRepository, ShopCartItemRepository>();
            services.AddScoped <ICarRepository, CarRepository>();
            services.AddScoped <ICategoryRepository, CategoryRepository>();
            services.AddScoped <IShopCartService, ShopCartService>();

            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            services.AddScoped(sp => IShopCartService.GetCart(sp));

            services.AddMvc(options => options.EnableEndpointRouting = false);
            services.AddMemoryCache();
            services.AddSession();
        }
コード例 #4
0
 public ShopCartController(IShopCartService shopCart)
 {
     _shopCart = shopCart;
 }
コード例 #5
0
 public ShoppingComponet(IShopCartService shopCartService, IOrderService orderService)
 {
     this.shopCartService = shopCartService;
     this.orderService    = orderService;
 }
コード例 #6
0
 public UserService(MyBooksDBContext context, IShopCartService shopCartService)
 {
     _context         = context;
     _shopCartService = shopCartService;
 }
コード例 #7
0
 public ShopCartController(IShopCartService shopCartService, LinkGenerator linkGanarator, ILoggerService logger, IUserService userService)
 {
     _linkGanarator   = linkGanarator;
     _logger          = logger;
     _shopCartService = shopCartService;
 }