Wrapped ASP.NET Core session state
This implementation wraps the session provided on ASP.NET Core so that it can be used with the adapters. The session will be using the same backing store as Microsoft.AspNetCore.Http.ISession
but will provide strongly-typed access to its members.
Configuration for ASP.NET Core would look similar to the following:
builder.Services.AddSystemWebAdapters()
.AddJsonSessionSerializer(options =>
{
// Serialization/deserialization requires each session key to be registered to a type
options.RegisterKey<int>("test-value");
options.RegisterKey<SessionDemoModel>("SampleSessionItem");
})
.WrapAspNetCoreSession();
The framework app would not need any changes to enable this behavior.
Met ons samenwerken op GitHub
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en controleren. Bekijk onze gids voor inzenders voor meer informatie.