Skip to content

Commit 1e35f80

Browse files
committed
Added a new overload to And method to allow easier chaining and transformations
1 parent c7f1011 commit 1e35f80

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Ogooreck/API/ApiSpecification.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ public static Func<HttpRequestMessage, HttpRequestMessage> HEADERS(params Action
4949
public static Action<HttpRequestHeaders> IF_MATCH(string ifMatch, bool isWeak = true) =>
5050
headers => headers.IfMatch.Add(new EntityTagHeaderValue($"\"{ifMatch}\"", isWeak));
5151

52-
5352
public static Action<HttpRequestHeaders> IF_MATCH(object ifMatch, bool isWeak = true) =>
5453
IF_MATCH(ifMatch.ToString()!, isWeak);
5554

56-
5755
public static Task<HttpResponseMessage> And(this Task<HttpResponseMessage> response,
5856
Func<HttpResponseMessage, HttpResponseMessage> and) =>
5957
response.ContinueWith(t => and(t.Result));
6058

61-
6259
public static Task And(this Task<HttpResponseMessage> response, Func<HttpResponseMessage, Task> and) =>
6360
response.ContinueWith(t => and(t.Result));
6461

62+
public static Task And<TResult>(this Task<HttpResponseMessage> response, Func<HttpResponseMessage, Task<TResult>> and) =>
63+
response.ContinueWith(t => and(t.Result));
64+
6565
public static Task And(this Task<HttpResponseMessage> response, Func<Task> and) =>
6666
response.ContinueWith(_ => and());
6767

src/Ogooreck/Ogooreck.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<VersionPrefix>0.2.1</VersionPrefix>
4+
<VersionPrefix>0.3.0</VersionPrefix>
55
<TargetFramework>net6.0</TargetFramework>
66
<GenerateAssemblyTitleAttribute>true</GenerateAssemblyTitleAttribute>
77
<GenerateAssemblyDescriptionAttribute>true</GenerateAssemblyDescriptionAttribute>

0 commit comments

Comments
 (0)