ServicePdfLiteSessionProvider Class |
Namespace: RadPdf.Lite
The ServicePdfLiteSessionProvider type exposes the following members.
Name | Description | |
---|---|---|
![]() | ServicePdfLiteSessionProvider |
Contructs a new ServicePdfLiteSessionProvider instance for use by RAD PDF.
|
Name | Description | |
---|---|---|
![]() | AddSession |
The default implementation of the PdfLiteSessionProvider which uses the ASP.NET Core Session State.
(Overrides PdfLiteSessionProviderAddSession(HttpContext, PdfLiteSession).) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | GenerateKey |
Gets a string which contains a randomly generated key using RNGCryptoServiceProvider.
(Inherited from PdfLiteSessionProvider.) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetSession |
Gets a PdfLiteSession from the provider associated with a given key.
(Overrides PdfLiteSessionProviderGetSession(HttpContext, String).) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Session keys created and stored in the system service will expire automatically at the same rate as other cache (12 hours by default).
using System; using System.Web; using RadPdf.Integration; public class CustomPdfIntegrationProvider : PdfIntegrationProvider { public CustomPdfIntegrationProvider() : base() { this.LiteSessionProvider = new ServicePdfLiteSessionProvider(); } }
using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using RadPdf; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorPages(); // Setup WebApplication var app = builder.Build(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); // Or however you normally process page requests app.MapRazorPages(); // Create middleware settings RadPdfCoreMiddlewareSettings settings = new RadPdfCoreMiddlewareSettings() { // Add License Key LicenseKey = "DEMO", // Attach the Integration Provider IntegrationProvider = new CustomPdfIntegrationProvider() }; // Add RAD PDF's middleware to app app.UseRadPdf(settings); app.Run();