예제 #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;
 }
 public UserService(MyBooksDBContext context, IShopCartService shopCartService)
 {
     _context         = context;
     _shopCartService = shopCartService;
 }
 public ShopCartController(IShopCartService shopCartService, LinkGenerator linkGanarator, ILoggerService logger, IUserService userService)
 {
     _linkGanarator   = linkGanarator;
     _logger          = logger;
     _shopCartService = shopCartService;
 }