コード例 #1
0
        public override async Task <CancelBidResponse> CancelBid(CancelBidRequest request, ServerCallContext context)
        {
            Guid entryId;

            if (!Guid.TryParse(request.EntryId, out entryId))
            {
                throw new RpcException(new Status(StatusCode.InvalidArgument, "entryid is not a guid"));
            }
            var entry = await _auctionService.CancelAuctionEntry(entryId);

            if (entry == null)
            {
                throw new RpcException(new Status(StatusCode.NotFound, "could not cancel bid"));
            }
            var res = new CancelBidResponse
            {
                Ok = true
            };

            return(res);
        }