示例#1
0
        public static IOperationResult Pipe(this IOperationResult operation, Func <IOperationResult> func)
        {
            if (operation.Fail())
            {
                return(operation);
            }

            return(func());
        }
示例#2
0
        public static async Task <IOperationResult> Pipe(this IOperationResult operation, Func <Task <IOperationResult> > func)
        {
            if (operation.Fail())
            {
                return(operation);
            }

            return(await func().ConfigureAwait(false));
        }
示例#3
0
 public static bool Success(this IOperationResult op) => !op.Fail();
示例#4
0
 public static bool IsFail(this IOperationResult op) => op.Fail();