Skip to content

Commit f9cdcc5

Browse files
committed
DisallowNull
1 parent 773f431 commit f9cdcc5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WebApiClientCore/ApiResponseContext.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics.CodeAnalysis;
23
using System.Threading.Tasks;
34

45
namespace WebApiClientCore
@@ -21,8 +22,8 @@ public object? Result
2122
set
2223
{
2324
this.result = value;
24-
this.exception = null;
2525
this.ResultStatus = ResultStatus.HasResult;
26+
this.exception = null;
2627
}
2728
}
2829

@@ -31,14 +32,15 @@ public object? Result
3132
/// 在IApiReturnAttribute设置该值之后会中断下一个IApiReturnAttribute的执行
3233
/// </summary>
3334
/// <exception cref="ArgumentNullException"></exception>
35+
[DisallowNull]
3436
public Exception? Exception
3537
{
3638
get => this.exception;
3739
set
3840
{
39-
this.result = null;
4041
this.exception = value ?? throw new ArgumentNullException(nameof(Exception));
4142
this.ResultStatus = ResultStatus.HasException;
43+
this.result = null;
4244
}
4345
}
4446

0 commit comments

Comments
 (0)