Sparkdo.AspNetCore
1.0.1
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sparkdo.AspNetCore --version 1.0.1
NuGet\Install-Package Sparkdo.AspNetCore -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sparkdo.AspNetCore" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.AspNetCore" Version="1.0.1" />
<PackageReference Include="Sparkdo.AspNetCore" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sparkdo.AspNetCore --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sparkdo.AspNetCore, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sparkdo.AspNetCore@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sparkdo.AspNetCore&version=1.0.1
#tool nuget:?package=Sparkdo.AspNetCore&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.AspNetCore
Sparkdo ASP.NET Core 集成库,提供与 ASP.NET Core 框架深度集成的功能实现。
功能特性
- ASP.NET Core 模块化集成:通过 Sparkdo 模块系统自动注册相关服务
- 审计日志:自动记录 HTTP 请求的审计信息
- 异常处理:统一处理 Web 请求中的异常并返回标准化错误响应
- 安全头:自动添加安全相关的 HTTP 响应头
- 工作单元:与 ASP.NET Core 请求生命周期集成的工作单元实现
- 虚拟文件系统:支持 Web 内容文件的虚拟文件系统实现
- 客户端信息:自动获取 Web 请求的客户端相关信息
- 请求本地化:支持基于请求的本地化功能
- 时区处理:自动处理请求时区信息
- 依赖注入:ASP.NET Core 作用域内的服务提供程序访问器
安装
<PackageReference Include="Sparkdo.AspNetCore" Version="x.x.x" />
核心组件
模块配置
SparkdoAspNetCoreModule: ASP.NET Core 集成模块,负责注册所有相关服务
中间件
SparkdoAuditingMiddleware: 审计日志中间件,记录 HTTP 请求的审计信息SparkdoExceptionHandlingMiddleware: 异常处理中间件,统一处理请求异常SparkdoSecurityHeadersMiddleware: 安全头中间件,添加安全相关的 HTTP 响应头SparkdoUnitOfWorkMiddleware: 工作单元中间件,管理请求生命周期内的工作单元SparkdoCorrelationIdMiddleware: 关联 ID 中间件,用于分布式追踪SparkdoRequestLocalizationMiddleware: 请求本地化中间件SparkdoTimeZoneMiddleware: 时区处理中间件
服务实现
HttpContextClientScopeServiceProviderAccessor: HTTP 上下文客户端作用域服务提供程序访问器DefaultHttpExceptionStatusCodeFinder: HTTP 异常状态码查找器DefaultSparkdoAuthorizationExceptionHandler: Sparkdo 授权异常处理器AspNetCoreSecurityLogManager: ASP.NET Core 安全日志管理器HttpContextCancellationTokenProvider: HTTP 上下文取消令牌提供程序AspNetCoreUnitOfWorkTransactionBehaviorProvider: ASP.NET Core 工作单元事务行为提供程序SparkdoWebContentFileProvider: Sparkdo Web 内容文件提供程序HttpContextWebClientInfoProvider: HTTP 上下文 Web 客户端信息提供程序
扩展性
该库提供了 ASP.NET Core 相关的完整实现,可以通过以下方式扩展:
- 自定义中间件来添加特定功能
- 实现自定义的服务接口来替换默认实现
- 通过配置选项来调整行为
- 继承和重写默认实现来定制功能
所有公共接口和类都添加了详细的 XML 文档注释,便于开发者理解和使用。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Duende.IdentityModel (>= 8.0.0-rc.1)
- JetBrains.Annotations (>= 2025.2.2)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 10.0.0)
- Microsoft.Extensions.DependencyModel (>= 10.0.0)
- Microsoft.Extensions.FileProviders.Embedded (>= 10.0.0)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 8.14.0)
- Microsoft.IdentityModel.Tokens (>= 8.14.0)
- MyCSharp.HttpUserAgentParser (>= 3.0.28)
- Nito.AsyncEx.Context (>= 5.1.2)
- Sparkdo.AspNetCore.Abstractions (>= 1.0.1)
- Sparkdo.Auditing (>= 1.0.1)
- Sparkdo.Authorization (>= 1.0.1)
- Sparkdo.ExceptionHandling (>= 1.0.1)
- Sparkdo.Http.Mime (>= 1.0.1)
- Sparkdo.Json (>= 1.0.1)
- Sparkdo.Uow (>= 1.0.1)
- Sparkdo.Validation (>= 1.0.1)
- Sparkdo.VirtualFileSystem (>= 1.0.1)
- System.Linq.Dynamic.Core (>= 1.7.0)
- TimeZoneConverter (>= 7.2.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Sparkdo.AspNetCore:
| Package | Downloads |
|---|---|
|
Sparkdo.AspNetCore.MultiTenancy
Sparkdo ASP.NET Core 多租户中间件库,提供基于中间件的多租户解析和管理功能 |
|
|
Sparkdo.AspNetCore.Mvc
Sparkdo ASP.NET Core MVC 库,提供对 ASP.NET Core MVC 的扩展和集成 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2-preview.1 | 137 | 12/4/2025 |
| 1.0.1 | 124 | 11/27/2025 |
| 1.0.0 | 133 | 11/25/2025 |
| 1.0.0-preview.5 | 102 | 10/24/2025 |