Skip to content

Commit 63b0e94

Browse files
committed
Create implicit conversion from HttpStatusCode
1 parent 95ac4a0 commit 63b0e94

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Initium/Results/ServiceResult.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public ServiceResult WithMetadata(string key, string value)
117117
/// <param name="result">The <see cref="ServiceResult"/> to convert.</param>
118118
public static implicit operator bool(ServiceResult result) => result.Success;
119119

120+
public static implicit operator HttpStatusCode?(ServiceResult result) => result.StatusCode;
121+
120122
/// <summary>
121123
/// Converts a boolean value to a <see cref="ServiceResult"/>.
122124
/// </summary>

0 commit comments

Comments
 (0)