public void AcceptOrder(AcceptOrderModel acceptedOrder) { _commandBus.SendCommand(new AcceptOrderCommand() { OrderId = acceptedOrder.OrderId, WaiterLogin = GetCallerLogin() }); }
private void WaiterApp_OrderWasAcceptedHandler(object sender, AcceptOrderModel acceptedOrder) { var orderToRemove = AwaitingOrders.FirstOrDefault(o => o.OrderId == acceptedOrder.OrderId); if (orderToRemove != null) { AwaitingOrders.Remove(orderToRemove); } }
public void OrderWasAccepted(AcceptOrderModel order) { Task.Run(() => HandleSafely(OrderWasAcceptedHandler, order)); //Should be awaited... }