Spryer.BuildTasks 0.9.11

dotnet add package Spryer.BuildTasks --version 0.9.11
                    
NuGet\Install-Package Spryer.BuildTasks -Version 0.9.11
                    
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="Spryer.BuildTasks" Version="0.9.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Spryer.BuildTasks" Version="0.9.11" />
                    
Directory.Packages.props
<PackageReference Include="Spryer.BuildTasks" />
                    
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 Spryer.BuildTasks --version 0.9.11
                    
#r "nuget: Spryer.BuildTasks, 0.9.11"
                    
#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 Spryer.BuildTasks@0.9.11
                    
#: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=Spryer.BuildTasks&version=0.9.11
                    
Install as a Cake Addin
#tool nuget:?package=Spryer.BuildTasks&version=0.9.11
                    
Install as a Cake Tool

Spryer.BuildTasks

The project provides MSBuild tasks to automate the generation of C# classes from SQL script files managed by the Spryer library's DbScriptMap class. This simplifies the process of working with SQL scripts within a .NET project.

Usage

After installing the NuGet package you need to add several elements to your .csproj file to configure the build task. This involves specifying the SQL script files and the desired output location and namespace for the generated C# classes. Here's an example:

<ItemGroup>
    
    <EmbeddedResource Include="Scripts\MyScripts.sql">
        <Generator>DbScriptMapCodeGenerator</Generator>  
        <CustomToolNamespace>MyProject.Scripts</CustomToolNamespace> 
    </EmbeddedResource>

    
    <None Include="Scripts\InlineScripts.sql">
        <Generator>DbScriptMapCodeGenerator</Generator>
        <CustomToolNamespace>MyProject.Scripts</CustomToolNamespace>
    </None>
</ItemGroup>

After the build completes, you can use the generated C# classes in your application code to access and execute the SQL scripts. Each class will contain extensions methods that correspond to the scripts defined in the SQL files. For example:

-- MyScripts.sql

--@query-first-default GetResult(@Id uniqueidentifier)
select * from Results where Id = @Id;
// Application code
using MyProject.Scripts;

// Accessing a script from the generated class
var connection = new SqlConnection(connectionString);
await connection.OpenAsync();
var result = await connection.GetResultAsync<ResultObject>(new { Id = resultId });
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.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
0.9.11 180 6/14/2025