SpToolkit.Runtime
0.1.0
dotnet add package SpToolkit.Runtime --version 0.1.0
NuGet\Install-Package SpToolkit.Runtime -Version 0.1.0
<PackageReference Include="SpToolkit.Runtime" Version="0.1.0" />
<PackageVersion Include="SpToolkit.Runtime" Version="0.1.0" />
<PackageReference Include="SpToolkit.Runtime" />
paket add SpToolkit.Runtime --version 0.1.0
#r "nuget: SpToolkit.Runtime, 0.1.0"
#:package SpToolkit.Runtime@0.1.0
#addin nuget:?package=SpToolkit.Runtime&version=0.1.0
#tool nuget:?package=SpToolkit.Runtime&version=0.1.0
SpToolKit
SpToolKit generates strongly-typed C# wrappers around SQL Server stored procedures and provides a small runtime to execute them. You maintain a JSON configuration, run a CLI against your database to emit .g.cs files, and inject IStoredProcedureExecutor where generated classes call into the database. The abstractions stay separate from the ADO.NET/EF Core implementation so you can keep generated code stable while swapping execution details.
Requirements
- .NET 10 (target framework for this repository’s projects)
- SQL Server (metadata and execution are oriented toward T-SQL stored procedures)
Installation
NuGet
Published package IDs (see docs/PUBLISHING.md for versioning, CI, and first-time publish):
| Package | Purpose |
|---|---|
SpToolkit.Abstractions |
Contracts and models used by generated code |
SpToolkit.Runtime |
IStoredProcedureExecutor, StoredProcedureExecutor, AddSpToolkit |
SpToolkit.Generator.Cli |
.NET global tool; command: sp-generate |
Current published version (stable): 0.1.0
dotnet add package SpToolkit.Abstractions --version 0.1.0
dotnet add package SpToolkit.Runtime --version 0.1.0
dotnet tool install --global SpToolkit.Generator.Cli --version 0.1.0
dotnet add package resolves stable versions automatically. For prerelease versions, add --prerelease or pass the explicit --version string.
Project reference
Add references to the library projects you need, for example:
<ItemGroup>
<ProjectReference Include="..\SpToolKit\src\SpToolkit.Abstractions\SpToolkit.Abstractions.csproj" />
<ProjectReference Include="..\SpToolKit\src\SpToolkit.Runtime\SpToolkit.Runtime.csproj" />
</ItemGroup>
Adjust the paths to match where you cloned or vendored the repository. Code generation is SpToolkit.Generator.Cli; run it from source with dotnet run (see Quick Start) or install the SpToolkit.Generator.Cli global tool from NuGet or a local pack.
Documentation
- CHANGELOG.md — release notes
- docs/PUBLISHING.md — branches, tags, packing, GitHub Actions, NuGet, releases
Release discipline (summary)
- Update CHANGELOG (move items from
[Unreleased]into the new version section). - Bump
Versionin Directory.Build.props (or rely on CI-p:Version=…from the tag). - Push
mainand confirm the CI workflow is green. - Create an annotated Git tag that matches the package version, e.g.
v0.1.0orv1.0.0:
git tag -a v0.1.0 -m "v0.1.0" && git push origin v0.1.0 - Open a GitHub Release from that tag; paste the matching CHANGELOG section as the release notes (see docs/PUBLISHING.md).
Quick Start
Create or edit the config file
Add asptoolkit.json(or copy from the example below) with at least connection string, output directory, and namespace—or plan to pass those via CLI flags (--connection,--output,--namespace).Run the generator CLI
From the repository root (or with paths adjusted), for example:dotnet run --project src/SpToolkit.Generator.Cli/SpToolkit.Generator.Cli.csproj -- --config sptoolkit.jsonUse
--dry-runto print the resolved configuration without writing files. When theSpToolkit.Generator.Clitool is installed, the entry point issp-generate.Register the executor in DI
In your application startup, callAddSpToolkit(orAddSpToolkit<TDbContext>when reusing an EF Core context). That registersIStoredProcedureExecutorfor use by generated wrapper types.services.AddSpToolkit(opts => { opts.ConnectionString = configuration.GetConnectionString("Default"); });
Configuration example
A commented template with all supported options is in the repository:
Copy it to sptoolkit.json (or another path and pass --config / -c), then fill in values for your environment.
License
See LICENSE.
| 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. |
-
net10.0
- Microsoft.Data.SqlClient (>= 7.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- SpToolkit.Abstractions (>= 0.1.0)
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 |
|---|---|---|
| 0.1.0 | 87 | 4/1/2026 |
| 0.1.0-preview.3 | 48 | 3/31/2026 |
| 0.1.0-preview.2 | 44 | 3/30/2026 |