public void UpdatePrices(PaymentProcessedPayload buy) { using (var scope = Services.CreateScope()) { var hubContext = scope.ServiceProvider.GetRequiredService <IHubContext <BrokerHub> >(); hubContext.Clients.Group(buy.BuyId).SendAsync("UpdatePrice", buy); } }
public PaymentProcessedPayload ProcessPayment(double amount, string buyId, CardPayload card) { Thread.Sleep(5000); // faz de conta que esse é o tempo de processar a transação em um gateway de pagamento var result = new PaymentProcessedPayload { BuyId = buyId, Amount = amount, Payd = PaymentAccepted() }; return(result); }