Exemplo n.º 1
0
        public static MarsResponse GetError(Exception ex)
        {
            MarsResponse response = new MarsResponse();

            response.Code  = HttpStatusCode.InternalServerError;
            response.Error = new MarsException(ex.InnerException == null ? ex.Message : ex.InnerException.Message);

            return(response);
        }
Exemplo n.º 2
0
        public static MarsResponse GetResponse(object data, HttpStatusCode code = HttpStatusCode.OK)
        {
            MarsResponse response = new MarsResponse();

            response.Code = code;
            response.Data = data;

            return(response);
        }