/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"> /// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only /// unmanaged resources. /// </param> protected virtual async ValueTask DisposeAsync(bool disposing) { if (disposing) { await _series.WriteAsync(_stream); _stream?.DisposeAsync(); } }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"> /// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only /// unmanaged resources. /// </param> protected virtual async ValueTask DisposeAsync(bool disposing) { if (disposing) { await _series.WriteAsync(_stream); #if NETSTANDARD2_1 _stream?.DisposeAsync(); #else _stream?.Dispose(); #endif } }