Sparkdo.Core 1.0.2-preview.1

This is a prerelease version of Sparkdo.Core.
dotnet add package Sparkdo.Core --version 1.0.2-preview.1
                    
NuGet\Install-Package Sparkdo.Core -Version 1.0.2-preview.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.Core" Version="1.0.2-preview.1" />
                    
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-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.Core" />
                    
Project file
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-preview.1
                    
#r "nuget: Sparkdo.Core, 1.0.2-preview.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.Core@1.0.2-preview.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.Core&version=1.0.2-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.Core&version=1.0.2-preview.1&prerelease
                    
Install as a Cake Tool

Sparkdo.Core

Sparkdo 核心库,提供框架基础功能和核心组件,包括依赖注入、模块化、异常处理等核心功能实现。

功能特性

  • 依赖注入扩展:提供增强的依赖注入功能,包括生命周期管理、缓存服务提供者等
  • 模块化系统:基于模块的应用程序架构,支持模块的生命周期管理
  • 异常处理:统一的异常处理机制,包括业务异常、用户友好异常等
  • 配置管理:扩展的配置系统,支持多种配置源
  • 实用工具类:各种常用的扩展方法和辅助类

核心组件

1. 应用程序基础 (ApplicationBase)

提供应用程序的基础实现,包含配置、初始化和关闭等生命周期管理。

2. 模块系统 (Modularity)

  • Module:模块抽象基类,定义模块生命周期方法
  • IModuleManager:模块管理器,负责模块的加载和生命周期管理
  • IModuleLoader:模块加载器,负责发现和加载模块

3. 依赖注入扩展

  • ICachedServiceProvider:缓存服务提供者,提高服务获取性能
  • SparkdoServiceProviderFactory:自定义服务提供者工厂
  • 生命周期属性:ScopedAttributeSingletonAttributeTransientAttribute

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 核心服务
builder.Services.AddSparkdoCore();

// 配置模块
await builder.Services.ConfigureSparkdoAsync();

var app = builder.Build();

// 初始化模块
await app.InitializeSparkdoAsync();

app.Run();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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-preview.1 199 12/4/2025
1.0.1 4,842 11/27/2025
1.0.0 4,736 11/25/2025
1.0.0-preview.5 114 10/24/2025