Sparkdo.Ddd.Domain.Shared 1.0.2

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Sparkdo.Ddd.Domain.Shared --version 1.0.2
                    
NuGet\Install-Package Sparkdo.Ddd.Domain.Shared -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.Ddd.Domain.Shared" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Ddd.Domain.Shared" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.Ddd.Domain.Shared" />
                    
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.Ddd.Domain.Shared --version 1.0.2
                    
#r "nuget: Sparkdo.Ddd.Domain.Shared, 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.Ddd.Domain.Shared@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.Ddd.Domain.Shared&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.Ddd.Domain.Shared&version=1.0.2
                    
Install as a Cake Tool

Sparkdo.Ddd.Domain.Shared

Sparkdo DDD 领域共享库,提供领域驱动设计中的共享内核实现,包括实体、值对象、领域事件等核心组件。

功能特性

  • DDD 领域实体基类定义
  • 分布式领域事件传输对象(Eto)定义
  • 实体到 ETO 映射配置
  • 多租户支持集成
  • 与 Sparkdo 事件总线无缝集成

安装

<PackageReference Include="Sparkdo.Ddd.Domain.Shared" Version="x.x.x" />

核心组件

分布式事件对象(ETO)

提供标准的分布式事件传输对象定义:

  • EntityCreatedEto<T>: 实体创建事件传输对象
  • EntityUpdatedEto<T>: 实体更新事件传输对象
  • EntityDeletedEto<T>: 实体删除事件传输对象
  • EntityEto: 通用实体事件传输对象基类

映射配置

提供实体到 ETO 的映射配置机制:

  • EtoMappingDictionary: ETO 映射字典
  • EtoMappingDictionaryItem: ETO 映射项
  • IEntityToEtoMapper: 实体到 ETO 映射器接口

选择器

提供类型选择器机制:

  • NamedTypeSelector: 命名类型选择器
  • AutoEntityDistributedEventSelectorList: 自动实体分布式事件选择器列表
  • IAutoEntityDistributedEventSelectorList: 自动实体分布式事件选择器列表接口

配置选项

  • SparkdoDistributedEntityEventOptions: 分布式实体事件配置选项

扩展性

该库提供了 DDD 领域共享的核心组件,可以通过以下方式扩展:

  1. 继承 EntityEto<T> 创建自定义的实体事件传输对象
  2. 通过 EtoMappingDictionary 配置实体到 ETO 的映射关系
  3. 实现 IEntityToEtoMapper 接口提供自定义映射逻辑
  4. 通过 SparkdoDistributedEntityEventOptions 配置分布式事件行为

代码结构说明

本项目包含以下主要组件:

分布式事件对象

  • EntityCreatedEto<TEntityEto>: 实体创建事件传输对象
  • EntityUpdatedEto<TEntityEto>: 实体更新事件传输对象
  • EntityDeletedEto<TEntityEto>: 实体删除事件传输对象
  • EntityEto: 通用实体事件传输对象基类
  • EntityEto<TKey>: 泛型实体事件传输对象基类

映射配置

  • EtoMappingDictionary: ETO 映射字典
  • EtoMappingDictionaryItem: ETO 映射项

选择器

  • AutoEntityDistributedEventSelectorList: 自动实体分布式事件选择器列表
  • NamedTypeSelector: 命名类型选择器

接口

  • IEntityEto<TKey>: 实体事件传输对象接口
  • IAutoEntityDistributedEventSelectorList: 自动实体分布式事件选择器列表接口
  • IEntityToEtoMapper: 实体到 ETO 映射器接口

配置

  • SparkdoDistributedEntityEventOptions: 分布式实体事件配置选项

所有公共接口和类都添加了详细的 XML 文档注释,便于开发者理解和使用。

Product 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Sparkdo.Ddd.Domain.Shared:

Package Downloads
Sparkdo.Ddd.Domain

Sparkdo DDD 领域模型库,提供领域驱动设计的核心组件实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3-preview.1 50 5/17/2026
1.0.2 289 4/27/2026
1.0.2-preview.5 77 4/15/2026
1.0.2-preview.4 94 2/8/2026
1.0.2-preview.3 99 2/1/2026
1.0.2-preview.2 111 1/31/2026
1.0.2-preview.1 195 12/4/2025
1.0.1 815 11/27/2025
1.0.0 778 11/25/2025
1.0.0-preview.5 139 10/24/2025