Exemplo n.º 1
0
        public async Task <IActionResult> ChangeItemPrice([FromBody] ChangePriceRequestModel auction)
        {
            bool success = await _service.ChangePrice(auction.AuctionId, auction.EndPrice, auction.Winner);

            if (success)
            {
                await _hubContext.Clients.All.SendAsync("PriceChanged", JsonConvert.SerializeObject(auction));

                return(Ok());
            }

            return(BadRequest());
        }