示例#1
0
 /// <summary>
 ///  设置泛型结果信息,并返回
 /// </summary>
 /// <typeparam name="TRes"></typeparam>
 /// <param name="res"></param>
 /// <param name="sysRet"></param>
 /// <param name="eMsg"></param>
 /// <returns></returns>
 public static TRes WithResult <TRes>(this TRes res, SysResultTypes sysRet, string eMsg)
     where TRes : ResultMo
 {
     return(res.WithResult((int)sysRet, (int)ResultTypes.Success, eMsg));
 }
示例#2
0
 /// <summary>
 ///  构造结果类
 /// </summary>
 /// <param name="sysRet">【系统/框架】 结果标识</param>
 /// <param name="ret">【业务】结果标识</param>
 /// <param name="message">结果信息描述</param>
 public ResultMo(SysResultTypes sysRet, ResultTypes ret, string message)
     : this((int) sysRet, (int) ret, message)
 {
 }
示例#3
0
 /// <summary>
 ///  构造异常结果类
 /// </summary>
 /// <param name="sysRet">【系统/框架】 结果标识</param>
 /// <param name="msg">结果信息描述</param>
 public ResultException(SysResultTypes sysRet, string msg) : base(msg)
 {
     sys_ret  = (int)sysRet;
     this.ret = (int)ret;
     this.msg = msg;
 }
示例#4
0
 /// <summary>
 ///  构造结果类
 /// </summary>
 /// <param name="sysRet">【系统/框架】 结果标识</param>
 /// <param name="message">结果信息描述</param>
 public ResultMo(SysResultTypes sysRet, string message = null)
     : this((int) sysRet, 0, message)
 {
 }
示例#5
0
 /// <summary>
 /// 【系统结果】是否是对应的类型
 /// </summary>
 /// <param name="res"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static bool IsSysResultType(this ResultMo res, SysResultTypes type) =>
 res.sys_ret == (int)type;