コード例 #1
0
        public static InvokedResult Fail(ErrorDescriber error)
        {
            if (error == null)
            {
                throw new ArgumentNullException("error");
            }

            var result = new InvokedResult {
                Succeeded = false
            };
            var list = new ErrorDescriber[] { error };

            result.Errors = list;
            return(result);
        }
コード例 #2
0
        public static InvokedResult <T> Fail <T>(ErrorDescriber error, T data)
        {
            if (error == null)
            {
                throw new ArgumentNullException("error");
            }

            var result = new InvokedResult <T> {
                Succeeded = false, Data = data
            };
            var list = new ErrorDescriber[] { error };

            result.Errors = list;
            return(result);
        }
コード例 #3
0
        public static InvokedResult Fail(string errorCode, string errorDescription)
        {
            if (errorCode == null)
            {
                throw new ArgumentNullException("errorCode");
            }

            var result = new InvokedResult {
                Succeeded = false
            };
            var list = new ErrorDescriber[] { new ErrorDescriber {
                                                  Code = errorCode, Description = errorDescription
                                              } };

            result.Errors = list;
            return(result);
        }