public async Task Bid(int auctionId, decimal bid, DateTime clientTime) { try { BidModel model = new BidModel() { AuctionId = auctionId, Bid = bid, BidderId = Context.User.GetUserId(), ClientTime = clientTime.ToUniversalTime(), ServerTime = DateTime.UtcNow }; //model.Valid = await _auctionService.ValidateBid(model); //write bid to db (bool, DateTime?)result = await _auctionService.AddBid(model, Context.User.Identity.Name); if (result.Item1) { //broadcast message to auction group with the new price await SendMessageToGroup($"Auction {auctionId}", "HighestBid", bid); } else { //send message to caller for invalid bid await SendPrivateMessage(Context.UserIdentifier, "InvalidBid", "Invalid bid"); } if (result.Item2.HasValue) { await SendMessageToGroup($"Auction {auctionId}", "TimeExtend", result.Item2.Value); } } catch (Exception x) { await SendPrivateMessage(Context.UserIdentifier, "InvalidBid", x.Message); } }