Sparkdo.Primitives
2.0.0-preview.2
This is a prerelease version of Sparkdo.Primitives.
dotnet add package Sparkdo.Primitives --version 2.0.0-preview.2
NuGet\Install-Package Sparkdo.Primitives -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.Primitives" 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.Primitives" Version="2.0.0-preview.2" />
<PackageReference Include="Sparkdo.Primitives" />
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.Primitives --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.Primitives, 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.Primitives@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.Primitives&version=2.0.0-preview.2&prerelease
#tool nuget:?package=Sparkdo.Primitives&version=2.0.0-preview.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.Primitives
Sparkdo.Primitives 是 Sparkdo Next 的基础便利核心包。它提供小型、稳定、可独立测试的 BCL-only primitives,服务业务开发者、框架内部和能力包作者。
适用对象
- 业务开发者:参数检查、一次性 disposable、随机字符串、字符串 token 提取。
- 框架内部:稳定排序、类型选择等基础算法。
- 能力包作者:不依赖 Core / Hosting / Runtime 的基础工具。
入口 API
第一版公开范围固定为:
Check
Ordering
TopologicalSorter
OrderableSorter
Disposables
DisposableAction
AsyncDisposableFunc
NullDisposable
NullAsyncDisposable
Random
RandomStringGenerator
TypeSelection
TypeSelectionCandidate
TypeSelectionRule
TypeSelectionMatcher
Text
StringTokenParser
StringTokenParseResult
包边界
Sparkdo.Primitives 只依赖 BCL。它不依赖 Core Runtime、Hosting、descriptor、generated bridge、VFS、HTTP、Localization、Scheduler、EF Core 或 ASP.NET Core。
第一版不实现 Result / Error、泛化 string / collection extensions、time extensions、reflection scanning、DI helper、template rendering 或旧 Module lifecycle helper。
常见误路
- 不要把 Primitives 当成
Utilities、Common或Extensions。 - 不要把 DI、VFS、HTTP、Culture、time policy 或 reflection helper 放进 Primitives。
- 不要让
StringTokenParser演化为模板引擎。 - 不要让
TypeSelection接管 runtime type discovery。 - 不要让 sorting result model 演化为业务
Result/Error模型。
验证入口
dotnet restore src/primitives/Sparkdo.Primitives.slnx
dotnet build src/primitives/Sparkdo.Primitives.slnx --no-restore -p:UseSharedCompilation=false -nr:false
dotnet test src/primitives/Sparkdo.Primitives.slnx --filter "Gate!=PackageAsset" --no-restore -p:UseSharedCompilation=false -nr:false
dotnet pack src/primitives/Sparkdo.Primitives.slnx -c Release -p:UseSharedCompilation=false -nr:false
dotnet test src/primitives/Sparkdo.Primitives.slnx --filter "Gate=PackageAsset" --no-restore -p:UseSharedCompilation=false -nr:false
| 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
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.2 | 68 | 7/20/2026 |
| 2.0.0-preview.1 | 66 | 7/18/2026 |