@@ -67,7 +67,7 @@ public interface IAsyncRequestContext : IRequestContext
67
67
{
68
68
AsyncCallback Callback { get ; }
69
69
object State { get ; }
70
- }
70
+ }
71
71
72
72
public interface IAsyncResponseContext : IResponseContext
73
73
{
@@ -96,7 +96,7 @@ public class RequestContext : IRequestContext
96
96
IDictionary < string , object > _contextAttributes ;
97
97
98
98
public RequestContext ( bool enableMetric )
99
- : this ( enableMetric , null )
99
+ : this ( enableMetric , null )
100
100
{
101
101
}
102
102
@@ -106,7 +106,6 @@ public RequestContext(bool enableMetrics, ISigner clientSigner)
106
106
this . Metrics = new RequestMetrics ( ) ;
107
107
this . Metrics . IsEnabled = enableMetrics ;
108
108
this . InvocationId = Guid . NewGuid ( ) ;
109
- this . UserAgentDetails = new UserAgentDetails ( ) ;
110
109
}
111
110
112
111
public IRequest Request { get ; set ; }
@@ -120,10 +119,10 @@ public RequestContext(bool enableMetrics, ISigner clientSigner)
120
119
public AmazonWebServiceRequest OriginalRequest { get ; set ; }
121
120
public IMarshaller < IRequest , AmazonWebServiceRequest > Marshaller { get ; set ; }
122
121
public ResponseUnmarshaller Unmarshaller { get ; set ; }
123
- public InvokeOptionsBase Options { get ; set ; }
122
+ public InvokeOptionsBase Options { get ; set ; }
124
123
public ISigner Signer { get ; set ; }
125
124
public BaseIdentity Identity { get ; set ; }
126
- public UserAgentDetails UserAgentDetails { get ; }
125
+ public UserAgentDetails UserAgentDetails { get => ( ( IAmazonWebServiceRequest ) OriginalRequest ) . UserAgentDetails ; }
127
126
128
127
#if AWS_ASYNC_API
129
128
public System . Threading . CancellationToken CancellationToken { get ; set ; }
@@ -162,11 +161,11 @@ internal set
162
161
163
162
public Guid InvocationId { get ; private set ; }
164
163
165
- public IDictionary < string , object > ContextAttributes
166
- {
164
+ public IDictionary < string , object > ContextAttributes
165
+ {
167
166
get
168
167
{
169
- if ( _contextAttributes == null )
168
+ if ( _contextAttributes == null )
170
169
{
171
170
_contextAttributes = new Dictionary < string , object > ( ) ;
172
171
}
@@ -180,7 +179,7 @@ public IDictionary<string, object> ContextAttributes
180
179
181
180
public class AsyncRequestContext : RequestContext , IAsyncRequestContext
182
181
{
183
- public AsyncRequestContext ( bool enableMetrics , ISigner clientSigner ) :
182
+ public AsyncRequestContext ( bool enableMetrics , ISigner clientSigner ) :
184
183
base ( enableMetrics , clientSigner )
185
184
{
186
185
}
@@ -191,7 +190,7 @@ public AsyncRequestContext(bool enableMetrics, ISigner clientSigner):
191
190
192
191
public class ResponseContext : IResponseContext
193
192
{
194
- public AmazonWebServiceResponse Response { get ; set ; }
193
+ public AmazonWebServiceResponse Response { get ; set ; }
195
194
public IWebResponseData HttpResponse { get ; set ; }
196
195
}
197
196
0 commit comments