/// <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> /// Writes a request to RequestStream. /// </summary> public Task Write(TRequest message) { return(requestStream.Write(message)); }