/// <summary> /// 捕捉错误相关信息 /// </summary> /// <param name="errorCode">错误编码枚举</param> protected void CacheError(ErrorCode errorCode) { this._hasError = true; this._errorCode = (int)errorCode; this._errorMessage = ErrorCodeExtension.GetErrorCodeDescription(errorCode).ErrorCodeDescription; }
public CResult(T data, ErrorCode errorCode, params object[] arg0) { this.Data = data; this.Code = (int)errorCode; var msg = ErrorCodeExtension.GetErrorCodeDescription(errorCode).Description; if (arg0.Length == 0) { this.Msg = msg; } else { this.Msg = string.Format(msg, arg0); } }
/// <summary> /// 构造函数 /// </summary> /// <param name="errorCode">错误编码枚举</param> public ProcessError(ErrorCode errorCode) { this._code = (int)errorCode; this._message = ErrorCodeExtension.GetErrorCodeDescription(errorCode).ErrorCodeDescription; }