using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Wdj { /// <summary> /// 操作返回结果,使用时建议判断State状态 /// </summary> public class Result : ResultHandler<int> { /// <summary> /// 初始化操作返回结果 /// </summary> public WdjResult() : base(true) { } /// <summary> /// 初始化操作返回结果 /// </summary> /// <param name="checkRef">是否检测操作来源</param> public WdjResult(bool checkRef) : base(checkRef) { } /// <summary> /// 初始化错误处理结果,直接返回提示信息 /// </summary> /// <param name="msg">错误提示信息</param> public WdjResult(string msg) : base(msg) { } /// <summary> /// 输出操作结果Json字符串 /// </summary> public override void WriteJson() { base.WriteResult(); } } /// <summary> /// 操作返回结果,使用时建议判断State状态 /// </summary> public class WdjResult<TEntity> : WdjResultHandler<TEntity> { /// <summary> /// 初始化操作返回结果 /// </summary> public WdjResult() : base(true) { } /// <summary> /// 初始化操作返回结果 /// </summary> /// <param name="checkRef">是否检测操作来源</param> public WdjResult(bool checkRef) : base(checkRef) { } /// <summary> /// 初始化错误处理结果,直接返回提示信息 /// </summary> /// <param name="msg">错误提示信息</param> public WdjResult(string msg) : base(msg) { } /// <summary> /// 输出操作结果Json字符串 /// </summary> public override void WriteJson() { base.WriteResult(); } } }
原文:http://www.cnblogs.com/wc918/p/6897154.html