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); }
public static MarsResponse GetResponse(object data, HttpStatusCode code = HttpStatusCode.OK) { MarsResponse response = new MarsResponse(); response.Code = code; response.Data = data; return(response); }