/// <summary> /// Writes all elements from given enumerable to the stream. /// Closes the stream afterwards unless close = false. /// </summary> public static async Task WriteAll <T>(this IClientStreamWriter <T> streamWriter, IEnumerable <T> elements, bool close = true) where T : class { foreach (var element in elements) { await streamWriter.Write(element); } if (close) { await streamWriter.Close(); } }
/// <summary> /// Closes the RequestStream. /// </summary> public Task Close() { return(requestStream.Close()); }