diff --git a/src/Common/ResultPattern/Result.cs b/src/Common/ResultPattern/Result.cs index 13e1ed7..dee665e 100644 --- a/src/Common/ResultPattern/Result.cs +++ b/src/Common/ResultPattern/Result.cs @@ -1,4 +1,5 @@ -using System.Text.Json.Serialization; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; namespace Common.ResultPattern; @@ -22,6 +23,7 @@ protected Result() /// The error associated with the failed result. protected Result(Error error) { + ArgumentNullException.ThrowIfNull(error); IsSuccess = false; Error = error; } @@ -29,6 +31,7 @@ protected Result(Error error) /// /// Gets a value indicating whether the result is successful. /// + [MemberNotNullWhen(false, nameof(Error))] public bool IsSuccess { get; } ///