Skip to content

Commit 337e405

Browse files
Improved OpResult
1 parent d08b385 commit 337e405

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<IsPackable>true</IsPackable>
7-
<Version>2.1.23</Version>
7+
<Version>2.1.24</Version>
88
<Authors>Andrey Serdyuk</Authors>
99
<Company>TaskHub</Company>
1010
<PackageTags>#TaskHub</PackageTags>

TaskHub.Shared.Response/OpResult.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ public class OpResult(int code, string message)
55
public bool IsSuccess => ResultCode == 0;
66
public int ResultCode { get; init; } = code;
77
public string Message { get; init; } = message;
8+
9+
public TResult As<TResult>() where TResult : Result => (TResult)(object)this;
810
}

0 commit comments

Comments
 (0)