Example #1
0
        private BetfairServerResponse <T> ToResponse <T>(JsonResponse <T> response, DateTime requestStart, DateTime lastByteStamp, long latency)
        {
            BetfairServerResponse <T> r = new BetfairServerResponse <T>();

            r.Error        = BetfairServerException.ToClientException(response.Error);
            r.HasError     = response.HasError;
            r.Response     = response.Result;
            r.LastByte     = lastByteStamp;
            r.RequestStart = requestStart;
            return(r);
        }
        public static BetfairServerException ToClientException(Data.Exceptions.Exception ex)
        {
            if (ex == null)
            {
                return(null);
            }

            var exception = new BetfairServerException();

            exception.ServerData   = ex.Data;
            exception.ServerDetail = ex.Detail;
            return(exception);
        }