Skip to content

Commit f171c56

Browse files
committed
Cleanup, bug fixes
1 parent 350fc7f commit f171c56

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Components/Components/src/Microsoft.AspNetCore.Components.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<ItemGroup>
2020
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
2121
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
22-
<Reference Include="System.IO.Pipelines" />
2322
</ItemGroup>
2423

2524
<!--

src/Components/Components/test/Lifetime/ComponentApplicationLifetimeTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using System.Buffers;
66
using System.Collections.Generic;
7+
using System.Linq;
78
using System.Threading.Tasks;
89
using Microsoft.AspNetCore.Components.Infrastructure;
910
using Microsoft.AspNetCore.Components.Lifetime;
@@ -237,7 +238,8 @@ public Task<IDictionary<string, ReadOnlySequence<byte>>> GetPersistedStateAsync(
237238

238239
public Task PersistStateAsync(IReadOnlyDictionary<string, ReadOnlySequence<byte>> state)
239240
{
240-
State = new Dictionary<string, ReadOnlySequence<byte>>(state);
241+
// We copy the data here because it's no longer available after this call completes.
242+
State = state.ToDictionary(kvp => kvp.Key, kvp => new ReadOnlySequence<byte>(kvp.Value.ToArray()));
241243
return Task.CompletedTask;
242244
}
243245
}

0 commit comments

Comments
 (0)