|
@@ -41,22 +41,12 @@ namespace DotNetCore.CAP |
|
|
/// Creates an <see cref="OperateResult" /> indicating a failed operation, with a list of <paramref name="errors" /> if |
|
|
/// Creates an <see cref="OperateResult" /> indicating a failed operation, with a list of <paramref name="errors" /> if |
|
|
/// applicable. |
|
|
/// applicable. |
|
|
/// </summary> |
|
|
/// </summary> |
|
|
|
|
|
/// <param name="ex">Operate Result exception</param> |
|
|
/// <param name="errors">An optional array of <see cref="OperateError" />s which caused the operation to fail.</param> |
|
|
/// <param name="errors">An optional array of <see cref="OperateError" />s which caused the operation to fail.</param> |
|
|
/// <returns> |
|
|
/// <returns> |
|
|
/// An <see cref="OperateResult" /> indicating a failed operation, with a list of <paramref name="errors" /> if |
|
|
/// An <see cref="OperateResult" /> indicating a failed operation, with a list of <paramref name="errors" /> if |
|
|
/// applicable. |
|
|
/// applicable. |
|
|
/// </returns> |
|
|
/// </returns> |
|
|
public static OperateResult Failed(params OperateError[] errors) |
|
|
|
|
|
{ |
|
|
|
|
|
var result = new OperateResult {Succeeded = false}; |
|
|
|
|
|
if (errors != null) |
|
|
|
|
|
{ |
|
|
|
|
|
result._errors.AddRange(errors); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static OperateResult Failed(Exception ex, params OperateError[] errors) |
|
|
public static OperateResult Failed(Exception ex, params OperateError[] errors) |
|
|
{ |
|
|
{ |
|
|
var result = new OperateResult |
|
|
var result = new OperateResult |
|
|