public void Handle(OrderItemRemoved evnt) { _connection.Delete( new { OrderId = evnt.OrderId, ProductId = evnt.ProductId }, "eventsourcing_sample_orderitem", _transaction); }
public void Apply(OrderItemRemoved e) { var item = Items.FirstOrDefault(i => i.PersonName == e.PersonName); if (item != null) { Items.Remove(item); } }
protected void MutateWhen(OrderItemRemoved @event) { // build new list var items = new List <OrderItem>(); items.AddRange(Items.Where(x => x.Name != @event.Name)); // set to list without item Items = items; }
private NpgsqlCommand ToCommand(OrderItemRemoved data) { var command = new NpgsqlCommand("DELETE FROM reads.order_item WHERE order_id = @Id and person_name = @PersonName"); command.Parameters.Add(new NpgsqlParameter("@PersonName", data.PersonName)); command.Parameters.Add(new NpgsqlParameter("@Id", data.OrderId)); return(command); }
private void WhenItemRemoved(OrderItemRemoved e, OrderView view) { // build new list var items = new List <OrderItem>(); items.AddRange(view.Items.Where(x => x.Name != e.Name)); // set to list without item view.Items = items; }
protected virtual void OnOrderItemRemoved(object sender, ModifyElementEventArgs <T> e) { OrderItemRemoved?.Invoke(this, e); }
protected virtual void OnOrderItemRemoved(ItemCollectionEventArgs eventArgs) { OrderItemRemoved.Invoke(this, eventArgs); }
protected virtual void Handle(OrderItemRemoved evnt) { _entityManager.DeleteByQuery<OrderItemEntity>(new { OrderId = evnt.OrderId, ProductId = evnt.ProductId }); }
protected virtual void Handle(OrderItemRemoved evnt) { _entityManager.DeleteByQuery <OrderItemEntity>(new { OrderId = evnt.OrderId, ProductId = evnt.ProductId }); }