forked from NetCoreStack/Proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponseContext.cs
More file actions
29 lines (26 loc) · 903 Bytes
/
Copy pathResponseContext.cs
File metadata and controls
29 lines (26 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Diagnostics;
using System.Net.Http;
namespace NetCoreStack.Proxy
{
public class ResponseContext: IDisposable
{
public RequestContext RequestContext { get; }
public string ResultContent { get; set; }
public HttpResponseMessage Response { get; set; }
public object Value { get; set; }
public ResponseContext(HttpResponseMessage response,
RequestContext requestContext,
Type genericReturnType = null)
{
Response = response ?? throw new ArgumentNullException(nameof(response));
RequestContext = requestContext ?? throw new ArgumentNullException(nameof(requestContext));
}
public void Dispose()
{
Debug.WriteLine("===Response Context disposing");
RequestContext.Dispose();
Response.Dispose();
}
}
}