Sparkdo.Domain.Shared
2.0.0-preview.2
This is a prerelease version of Sparkdo.Domain.Shared.
dotnet add package Sparkdo.Domain.Shared --version 2.0.0-preview.2
NuGet\Install-Package Sparkdo.Domain.Shared -Version 2.0.0-preview.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.Domain.Shared" Version="2.0.0-preview.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Domain.Shared" Version="2.0.0-preview.2" />
<PackageReference Include="Sparkdo.Domain.Shared" />
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.Domain.Shared --version 2.0.0-preview.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sparkdo.Domain.Shared, 2.0.0-preview.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.Domain.Shared@2.0.0-preview.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.Domain.Shared&version=2.0.0-preview.2&prerelease
#tool nuget:?package=Sparkdo.Domain.Shared&version=2.0.0-preview.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.Domain.Shared
Sparkdo.Domain.Shared 是 Sparkdo DDD 的最小共享契约包。当前只提供 DomainException,用于在保持领域层纯净的同时表达可被应用层和异常处理适配器识别的领域错误。
该包只依赖 .NET 基础类库,不依赖 EF Core、工作单元、EventBus、审计、ASP.NET Core 或依赖注入。code 与 message 在构造时必须为非空白字符串,并按原始内容保存。
using Sparkdo.Domain.Shared;
throw new DomainException("orders.invalid_state", "订单当前状态不允许执行该操作。");
异常处理适配器可以在外部把 DomainException.Code 映射到现有 Sparkdo ExceptionHandling 元数据;本包不会反向引用异常处理产品域。
| 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
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Sparkdo.Domain.Shared:
| Package | Downloads |
|---|---|
|
Sparkdo.Domain
Sparkdo DDD 的纯领域模型、聚合根、值对象和领域事件契约。 |
|
|
Sparkdo.ExceptionHandling.Domain
Sparkdo DomainException 到 ExceptionHandling 的可选元数据适配。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.2 | 51 | 7/20/2026 |