Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        /// <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);
        }