/// <summary> /// 成功结果 /// </summary> /// <param name="message">成功消息</param> /// <param name="data">成功时候需要返回的数据对象</param> /// <returns>OperatedResult</returns> public static OperatedResult <T> Success(string message, T data) { OperatedResult <T> successResult = new OperatedResult <T>(message, data, true); return(successResult); }
/// <summary> /// 成功结果 /// </summary> /// <param name="data">成功时候需要返回的数据对象</param> /// <returns>OperatedResult</returns> public static OperatedResult <T> Success(T data) { OperatedResult <T> successResult = new OperatedResult <T>(null, data, true); return(successResult); }
/// <summary> /// 失败结果 /// </summary> /// <param name="message">失败内容</param> /// <returns>OperatedResult</returns> public static OperatedResult <T> Fail(string message) { OperatedResult <T> failResult = new OperatedResult <T>(message, default(T), false); return(failResult); }