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); }
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); }
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); }