SourceKit.Generators.Builder 1.2.52

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

SourceKit.Generators.Builder

Use [GenerateBuilder] attribute to generate builder.

  • Only record or record struct types are supported
  • Builder is a nested class Builder
  • For collection properties field of type List<> will be generated
  • For collection properties, methods With{PropName} and With{PropName}s will be generated
  • If collection element type is IComparable or IComparable<TSelf> the .Distinct LINQ method would be called on .Build method
  • If collection property is List<> or HashSet<> then it will be converted to this collection respectively, otherwise, ToArray method will be called

You can use SomeType.Build() static method to shorthand create type instance using generated builder

[GenerateBuilder]
public partial record SomeQuery(IReadOnlyCollection<Guid> Ids, int Count = 10);

...

var query = SomeQuery.Build(x => x.WithCount(2).WithId(Guid.NewGuid());

Default values for record properties are supported

Required properties

You can annotate property with [RequiredValue] attribute to force compile time error when it is not initialized withing Build method of model.

[GenerateBuilder]
public partial record SomeQuery(long[] Ids, [RequiredValue] int PageSize);

The following code will produce an error.

var query = SomeQuery.Build(x => x.WithId(1));
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SourceKit.Generators.Builder:

Package Downloads
Itmo.Dev.Platform.BackgroundTasks

Package Description

Itmo.Dev.Platform.MessagePersistence

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.52 86 1/3/2026
1.2.51 175 12/20/2025
1.2.50 1,502 5/16/2025
1.2.49 507 1/13/2025
1.2.48 170 1/13/2025
1.2.47 177 1/12/2025
1.2.46 195 1/12/2025
1.2.45 656 12/15/2024
1.2.44 392 12/15/2024
1.2.43 184 12/15/2024
1.2.42 181 12/15/2024
1.2.41 206 12/15/2024
1.2.40 198 12/15/2024
1.2.37 209 12/14/2024
1.2.36 683 11/18/2024
1.2.35 276 10/11/2024
1.2.34 324 5/4/2024
1.2.33 201 5/1/2024
1.2.31 242 4/27/2024
1.2.30 289 4/6/2024
1.1.29 248 4/3/2024
1.1.27 243 4/3/2024
1.1.26 230 4/3/2024
1.1.24 7,231 12/19/2023
1.1.23 306 12/6/2023
1.1.22 451 11/22/2023
1.1.21 704 11/11/2023
1.1.20 164 11/11/2023
1.1.19 241 11/11/2023
1.1.18 195 11/11/2023
1.1.16 172 11/11/2023
1.1.15 212 11/11/2023
1.1.14 221 11/11/2023
1.1.13 225 11/11/2023
1.1.11 180 11/11/2023
1.1.10 283 9/16/2023
1.1.4 358 9/10/2023
1.0.4 1,727 6/11/2023
1.0.3 285 6/10/2023
1.0.2 259 6/10/2023
1.0.1 493 5/14/2023
1.0.0 378 5/13/2023

Added default values support