@@ -84,45 +84,24 @@ public AsyncClientStreamingCall(IClientStreamWriter<TRequest> requestStream,
84
84
/// <summary>
85
85
/// Asynchronous call result.
86
86
/// </summary>
87
- public Task < TResponse > ResponseAsync
88
- {
89
- get
90
- {
91
- return this . responseAsync ;
92
- }
93
- }
87
+ public Task < TResponse > ResponseAsync => this . responseAsync ;
94
88
95
89
/// <summary>
96
90
/// Asynchronous access to response headers.
97
91
/// </summary>
98
- public Task < Metadata > ResponseHeadersAsync
99
- {
100
- get
101
- {
102
- return callState . ResponseHeadersAsync ( ) ;
103
- }
104
- }
92
+ public Task < Metadata > ResponseHeadersAsync => callState . ResponseHeadersAsync ( ) ;
105
93
106
94
/// <summary>
107
95
/// Async stream to send streaming requests.
108
96
/// </summary>
109
- public IClientStreamWriter < TRequest > RequestStream
110
- {
111
- get
112
- {
113
- return requestStream ;
114
- }
115
- }
97
+ public IClientStreamWriter < TRequest > RequestStream => requestStream ;
116
98
117
99
/// <summary>
118
100
/// Gets an awaiter used to await this <see cref="AsyncClientStreamingCall{TRequest,TResponse}"/>.
119
101
/// </summary>
120
102
/// <returns>An awaiter instance.</returns>
121
103
/// <remarks>This method is intended for compiler use rather than use directly in code.</remarks>
122
- public TaskAwaiter < TResponse > GetAwaiter ( )
123
- {
124
- return responseAsync . GetAwaiter ( ) ;
125
- }
104
+ public TaskAwaiter < TResponse > GetAwaiter ( ) => responseAsync . GetAwaiter ( ) ;
126
105
127
106
/// <summary>
128
107
/// Configures an awaiter used to await this <see cref="AsyncClientStreamingCall{TRequest,TResponse}"/>.
@@ -132,27 +111,19 @@ public TaskAwaiter<TResponse> GetAwaiter()
132
111
/// </param>
133
112
/// <returns>An object used to await this task.</returns>
134
113
public ConfiguredTaskAwaitable < TResponse > ConfigureAwait ( bool continueOnCapturedContext )
135
- {
136
- return responseAsync . ConfigureAwait ( continueOnCapturedContext ) ;
137
- }
114
+ => responseAsync . ConfigureAwait ( continueOnCapturedContext ) ;
138
115
139
116
/// <summary>
140
117
/// Gets the call status if the call has already finished.
141
118
/// Throws InvalidOperationException otherwise.
142
119
/// </summary>
143
- public Status GetStatus ( )
144
- {
145
- return callState . GetStatus ( ) ;
146
- }
120
+ public Status GetStatus ( ) => callState . GetStatus ( ) ;
147
121
148
122
/// <summary>
149
123
/// Gets the call trailing metadata if the call has already finished.
150
124
/// Throws InvalidOperationException otherwise.
151
125
/// </summary>
152
- public Metadata GetTrailers ( )
153
- {
154
- return callState . GetTrailers ( ) ;
155
- }
126
+ public Metadata GetTrailers ( ) => callState . GetTrailers ( ) ;
156
127
157
128
/// <summary>
158
129
/// Provides means to cleanup after the call.
@@ -164,21 +135,13 @@ public Metadata GetTrailers()
164
135
/// Normally, there is no need for you to dispose the call unless you want to utilize the
165
136
/// "Cancel" semantics of invoking <c>Dispose</c>.
166
137
/// </remarks>
167
- public void Dispose ( )
168
- {
169
- callState . Dispose ( ) ;
170
- }
138
+ public void Dispose ( ) => callState . Dispose ( ) ;
171
139
172
140
private string DebuggerToString ( ) => CallDebuggerHelpers . DebuggerToString ( callState ) ;
173
141
174
- private sealed class AsyncClientStreamingCallDebugView
142
+ private sealed class AsyncClientStreamingCallDebugView ( AsyncClientStreamingCall < TRequest , TResponse > call )
175
143
{
176
- private readonly AsyncClientStreamingCall < TRequest , TResponse > _call ;
177
-
178
- public AsyncClientStreamingCallDebugView ( AsyncClientStreamingCall < TRequest , TResponse > call )
179
- {
180
- _call = call ;
181
- }
144
+ private readonly AsyncClientStreamingCall < TRequest , TResponse > _call = call ;
182
145
183
146
public bool IsComplete => CallDebuggerHelpers . GetStatus ( _call . callState ) != null ;
184
147
public Status ? Status => CallDebuggerHelpers . GetStatus ( _call . callState ) ;
0 commit comments