A collection of abstractions to provide support for enabling configuration for Microsoft.AspNetCore.SystemWebAdapters.
$ dotnet add package Microsoft.AspNetCore.SystemWebAdapters.AbstractionsProvides shared abstractions and interfaces for configuring System Web Adapters in both ASP.NET Core and ASP.NET Framework applications.
This package is typically used as a dependency by other System Web Adapters packages. Most applications don't need to reference it directly.
Use this package when building extension libraries:
using Microsoft.AspNetCore.SystemWebAdapters;
public static class MyAdapterExtensions
{
public static ISystemWebAdapterBuilder AddMyCustomFeature(
this ISystemWebAdapterBuilder builder)
{
builder.Services.AddSingleton<IMyService, MyService>();
return builder;
}
}
Implement custom serializers for session state:
using Microsoft.AspNetCore.SystemWebAdapters.SessionState;
public class MySessionSerializer : ISessionKeySerializer
{
public bool TrySerialize(string key, object? obj, out byte[] bytes)
{
// Implement serialization logic
}
public bool TryDeserialize(string key, byte[] bytes, out object? obj)
{
// Implement deserialization logic
}
}