public void Apply(ProductPriceChanged @event) { var view = ServiceLocator.ProductView; var product = view.GetById(@event.Id); product.Price = @event.NewPrice; }
public void Apply(ProductPriceChanged e) { var product = GetById(e.Id); product.Price = e.NewPrice; product.Version = e.Version; repository.Update(product); }
public async Task HandleAsync(ProductPriceChanged @event) { var cart = await cartRepository.GetByIdAsync(@event.AggregateId.IdAsString()); var priceItem = new ProductPriceDto() { CurrentPrice = @event.Quantity, Id = @event.PriceId, Date = DateTimeOffset.Now, ItemId = cart.Id }; cart.Price = @event.Quantity; await cartRepository.UpdateAsync(cart); await cartItemRepository.InsertAsync(priceItem); }
private void Apply(ProductPriceChanged e) { Price = e.NewPrice; }
void Apply(ProductPriceChanged e) { _price = e.Price; }
public void Apply(ProductPriceChanged productPriceChanged) { this.Price = productPriceChanged.Price; }
protected bool Equals(ProductPriceChanged other) => base.Equals(other) && Price == other.Price && OccurredOn.Equals(other.OccurredOn) && Version == other.Version;
public void WhenProductPriceChanged(ProductPriceChanged @event) { Price = @event.Price; }