public void Pay(string orderId) { _orderStatuses[orderId] = "Waiting to pay"; Task.Run(() => { Thread.Sleep(2000); OrderPaid?.Invoke(this, new EventArgs()); }); }
public void OnOrderPaid(string message) => _handlerPaid?.Invoke(message); //C# 6.0 feature: expression bodied method