@@ -4,56 +4,56 @@ namespace FluentHttpClient;
4
4
5
5
public static class FluentJsonDeserialization
6
6
{
7
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < Stream > result )
7
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < Stream > result )
8
8
{
9
9
return await result . DeserializeJsonAsync < T > ( FluentHttpClient . DefaultJsonSerializerOptions ) ;
10
10
}
11
11
12
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < Stream > result , JsonSerializerOptions options )
12
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < Stream > result , JsonSerializerOptions options )
13
13
{
14
14
return await JsonSerializer . DeserializeAsync < T > ( await result , options ) ;
15
15
}
16
16
17
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < String > result )
17
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < String > result )
18
18
{
19
19
return await result . DeserializeJsonAsync < T > ( FluentHttpClient . DefaultJsonSerializerOptions ) ;
20
20
}
21
21
22
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < string > result , JsonSerializerOptions options )
22
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < string > result , JsonSerializerOptions options )
23
23
{
24
24
return JsonSerializer . Deserialize < T > ( await result , options ) ;
25
25
}
26
26
27
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > result )
27
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > result )
28
28
{
29
29
return await result . DeserializeJsonAsync < T > ( FluentHttpClient . DefaultJsonSerializerOptions ) ;
30
30
}
31
31
32
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > taskResponse , JsonSerializerOptions options )
32
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > taskResponse , JsonSerializerOptions options )
33
33
{
34
34
var response = await taskResponse ;
35
35
return JsonSerializer . Deserialize < T > ( await response . GetResponseStreamAsync ( ) , options ) ;
36
36
}
37
37
38
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > result , Func < HttpResponseMessage , T > defaultAction )
38
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > result , Func < HttpResponseMessage , T > defaultAction )
39
39
{
40
40
return await result . DeserializeJsonAsync < T > ( defaultAction , FluentHttpClient . DefaultJsonSerializerOptions ) ;
41
41
}
42
42
43
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > taskResponse , Func < HttpResponseMessage , T > defaultAction , JsonSerializerOptions options )
43
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > taskResponse , Func < HttpResponseMessage , T > defaultAction , JsonSerializerOptions options )
44
44
{
45
45
var response = await taskResponse ;
46
46
return ( response . IsSuccessStatusCode )
47
47
? JsonSerializer . Deserialize < T > ( await response . GetResponseStreamAsync ( ) , options )
48
48
: defaultAction ( response ) ;
49
49
}
50
50
51
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > result , Func < HttpResponseMessage , Task < T > > defaultAction )
51
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > result , Func < HttpResponseMessage , Task < T > > defaultAction )
52
52
{
53
53
return await result . DeserializeJsonAsync < T > ( defaultAction , FluentHttpClient . DefaultJsonSerializerOptions ) ;
54
54
}
55
55
56
- public static async Task < T > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > taskResponse , Func < HttpResponseMessage , Task < T > > defaultAction , JsonSerializerOptions options )
56
+ public static async Task < T ? > DeserializeJsonAsync < T > ( this Task < HttpResponseMessage > taskResponse , Func < HttpResponseMessage , Task < T > > defaultAction , JsonSerializerOptions options )
57
57
{
58
58
var response = await taskResponse ;
59
59
return ( response . IsSuccessStatusCode )
0 commit comments