public BasketsController( ShoppingBasketDbContext dbContext, DiscountService discountService, IMessageProducer <BasketCheckoutMessage> producer ) { _dbContext = dbContext; _discountService = discountService; _producer = producer; }
public async Task UpdatePricesForIntegrationEvent(Models.PriceUpdate priceUpdate) { await using (var shoppingBasketDbContext = new ShoppingBasketDbContext(dbContextOptions)) { var basketLinesToUpdate = shoppingBasketDbContext.BasketLines.Where(x => x.EventId == priceUpdate.EventId); await basketLinesToUpdate.ForEachAsync((basketLineToUpdate) => basketLineToUpdate.Price = priceUpdate.Price ); await shoppingBasketDbContext.SaveChangesAsync(); } }
public BasketChangeEventController(ShoppingBasketDbContext dbContext) { _dbContext = dbContext; }
public Handler(ShoppingBasketDbContext context) { _context = context; }
public RequestValidator(ShoppingBasketDbContext context) { RuleFor(x => x.BasketId).EntityExists(context, typeof(Basket)); RuleFor(x => x.BasketLineId).EntityExists(context, typeof(BasketLine)); RuleFor(x => x.Quantity).GreaterThanOrEqualTo(0); }
public BasketLinesController(ShoppingBasketDbContext dbContext, EventCatalogService eventCatalogService) { _dbContext = dbContext; _eventCatalogService = eventCatalogService; }
public BasketLinesRepository(ShoppingBasketDbContext shoppingBasketDbContext) { _shoppingBasketDbContext = shoppingBasketDbContext; }
public BasketRepository(ShoppingBasketDbContext shoppingBasketDbContext) { this._shoppingBasketDbContext = shoppingBasketDbContext; }
public BasketRepository(ShoppingBasketDbContext dbContext) { _dbContext = dbContext; }
public BasketChangeEventRepository(ShoppingBasketDbContext shoppingBasketDbContext) { this.shoppingBasketDbContext = shoppingBasketDbContext; }
public RequestValidator(ShoppingBasketDbContext context) { RuleFor(x => x.BasketId).EntityExists(context, typeof(Basket)); }
public EFEventRepository(ShoppingBasketDbContext shoppingBasketDbContext) { _shoppingBasketDbContext = shoppingBasketDbContext; }
public RequestValidator(ShoppingBasketDbContext context) { RuleFor(x => x.BasketId).EntityExists(context, typeof(Basket)); RuleFor(x => x.BasketLineForCreation.EventId).EntityExists(context, typeof(Event)); }
public Handler(ShoppingBasketDbContext context, IMessageBus messageBus) { _context = context; _messageBus = messageBus; }