Sparkdo.Core
1.0.2
dotnet add package Sparkdo.Core --version 1.0.2
NuGet\Install-Package Sparkdo.Core -Version 1.0.2
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.Core" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Core" Version="1.0.2" />
<PackageReference Include="Sparkdo.Core" />
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.Core --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sparkdo.Core, 1.0.2"
#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.Core@1.0.2
#: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.Core&version=1.0.2
#tool nuget:?package=Sparkdo.Core&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.Core
Sparkdo 核心库,提供框架基础功能和核心组件,包括依赖注入、模块化、异常处理等核心功能实现。
功能特性
- 依赖注入扩展:提供增强的依赖注入功能,包括生命周期管理、缓存服务提供者等
- 模块化系统:基于模块的应用程序架构,支持模块的生命周期管理
- 异常处理:统一的异常处理机制,包括业务异常、用户友好异常等
- 配置管理:扩展的配置系统,支持多种配置源
- 实用工具类:各种常用的扩展方法和辅助类
核心组件
1. 应用程序基础 (ApplicationBase)
提供应用程序的基础实现,包含配置、初始化和关闭等生命周期管理。
2. 模块系统 (Modularity)
Module:模块抽象基类,定义模块生命周期方法IModuleManager:模块管理器,负责模块的加载和生命周期管理IModuleLoader:模块加载器,负责发现和加载模块
3. 依赖注入扩展
ICachedServiceProvider:缓存服务提供者,提高服务获取性能SparkdoServiceProviderFactory:自定义服务提供者工厂- 生命周期属性:
ScopedAttribute、SingletonAttribute、TransientAttribute
4. 异常处理
BusinessException:业务异常基类UserFriendlyException:用户友好异常SparkdoException:框架异常基类
安装
dotnet add package Sparkdo.Core
使用示例
创建自定义模块
public class MyModule : Module
{
public override void Configure(IConfigureContext context)
{
// 注册服务
context.Services.AddScoped<IMyService, MyService>();
}
public override void Initialize(IInitializeContext context)
{
// 初始化操作
}
}
应用程序启动
var builder = WebApplication.CreateBuilder(args);
// 添加 Sparkdo 服务
var sparkdo = await builder.Services.AddSparkdoAsync();
var app = builder.Build();
// 初始化模块
await app.InitializeAsync(app.Services);
app.Run();
| 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
- JetBrains.Annotations (>= 2025.2.4)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.5)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.5)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.5)
- Microsoft.Extensions.Configuration.Json (>= 10.0.5)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.DependencyModel (>= 10.0.5)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Localization (>= 10.0.5)
- Microsoft.Extensions.Logging (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.5)
- Nito.AsyncEx.Context (>= 5.1.2)
- System.Linq.Dynamic.Core (>= 1.7.1)
NuGet packages (39)
Showing the top 5 NuGet packages that depend on Sparkdo.Core:
| Package | Downloads |
|---|---|
|
Sparkdo.Localization.Abstractions
Sparkdo 本地化抽象模块,提供本地化功能的抽象接口和基础实现 |
|
|
Sparkdo.Security
Sparkdo 安全模块,提供身份验证、授权、加密和安全日志等核心安全功能 |
|
|
Sparkdo.Validation.Abstractions
Sparkdo 验证抽象库,提供验证相关的基础接口和异常类型定义 |
|
|
Sparkdo.VirtualFileSystem.Abstractions
Sparkdo 虚拟文件系统抽象库,定义了虚拟文件系统的接口和核心抽象 |
|
|
Sparkdo.Uow.Abstractions
Sparkdo 框架的工作单元模式抽象实现。提供接口和基础类用于实现具有事务支持、事件发布和数据库 API 管理的工作单元模式。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 1,191 | 4/27/2026 |
| 1.0.2-preview.5 | 201 | 4/15/2026 |
| 1.0.2-preview.4 | 210 | 2/8/2026 |
| 1.0.2-preview.3 | 230 | 2/1/2026 |
| 1.0.2-preview.2 | 228 | 1/31/2026 |
| 1.0.2-preview.1 | 237 | 12/4/2025 |
| 1.0.1 | 4,899 | 11/27/2025 |
| 1.0.0 | 4,784 | 11/25/2025 |
| 1.0.0-preview.5 | 151 | 10/24/2025 |