FluentBuilder 0.16.0
Usage
:one: Annotate a class
Annotate a class with [AutoGenerateBuilder] to indicate that a FluentBuilder should be generated for this class:
[AutoGenerateBuilder]
public class User
{
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime? Date { get; set; }
}
:two: Define a class which needs to act as a builder
This scenario is very usefull when you cannot modify the class to annotate it.
Create a public and partial builder class
And annotate this class with [AutoGenerateBuilder(typeof(XXX))] where XXX is the type for which you want to generate a FluentBuilder.
[AutoGenerateBuilder(typeof(UserDto))]
public partial class MyUserDtoBuilder
{
}
Use FluentBuilder
using System;
namespace Test;
class Program
{
static void Main(string[] args)
{
var user = new UserBuilder()
.WithFirstName("Test")
.WithLastName("User")
.Build();
Console.WriteLine($"{user.FirstName} {user.LastName}");
}
}
For more information, see the StefH/FluentBuilder.
Sponsors
Entity Framework Extensions and Dapper Plus are major sponsors and proud to contribute to the development of FluentBuilder.
Showing the top 20 packages that depend on FluentBuilder.
| Packages | Downloads |
|---|---|
|
WireMock.Net.Abstractions
Commonly used interfaces, models, enumerations and types.
|
21 |
0.16.0 (31 October 2026)
- #78 Fix: multiple AutoGenerateBuilder(typeof) classes produce no output [bug]
- #80 Fix CS1751 for array constructor parameters with default value [bug]
- #61 AutoGenerateBuilder for type doesn't generate classess [enhancement]
- #79 Error CS1751 : Cannot specify a default value for a parameter collection [bug]
The full release notes can be found here: https://github.com/StefH/FluentBuilder/blob/main/ReleaseNotes.md
.NET Standard 2.0
- No dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 0.16.0 | 2 | 11/01/2026 |
| 0.15.0 | 29 | 10/01/2026 |
| 0.14.0 | 18 | 10/01/2026 |
| 0.13.0 | 20 | 10/01/2026 |
| 0.12.0 | 23 | 10/01/2026 |
| 0.11.0 | 21 | 10/01/2026 |
| 0.11.0-preview-02 | 21 | 10/01/2026 |
| 0.11.0-preview-01 | 23 | 10/01/2026 |
| 0.10.0.4-preview-01 | 21 | 10/01/2026 |
| 0.10.0.3-preview-01 | 18 | 10/01/2026 |
| 0.10.0.2 | 22 | 10/01/2026 |
| 0.10.0.1 | 21 | 10/01/2026 |
| 0.10.0 | 23 | 10/01/2026 |
| 0.9.2 | 24 | 10/01/2026 |
| 0.9.1 | 19 | 10/01/2026 |
| 0.9.0 | 21 | 10/01/2026 |
| 0.9.0-preview-01 | 19 | 10/01/2026 |
| 0.8.0 | 22 | 10/01/2026 |
| 0.7.1 | 24 | 10/01/2026 |
| 0.7.1-preview-02 | 22 | 10/01/2026 |
| 0.7.1-preview-01 | 24 | 10/01/2026 |
| 0.7.0 | 22 | 10/01/2026 |
| 0.7.0-preview-01 | 21 | 10/01/2026 |
| 0.6.0 | 21 | 10/01/2026 |
| 0.5.1 | 21 | 10/01/2026 |
| 0.5.0 | 19 | 10/01/2026 |
| 0.4.9 | 21 | 10/01/2026 |
| 0.4.8 | 23 | 10/01/2026 |
| 0.4.7 | 22 | 10/01/2026 |
| 0.4.6 | 22 | 10/01/2026 |
| 0.4.5 | 21 | 10/01/2026 |
| 0.4.4 | 23 | 10/01/2026 |
| 0.4.2 | 20 | 10/01/2026 |
| 0.4.1 | 20 | 10/01/2026 |
| 0.4.0 | 22 | 10/01/2026 |
| 0.3.3 | 20 | 10/01/2026 |
| 0.3.2 | 22 | 10/01/2026 |
| 0.3.1 | 20 | 10/01/2026 |
| 0.3.0 | 23 | 10/01/2026 |
| 0.2.5 | 20 | 10/01/2026 |
| 0.2.4 | 24 | 10/01/2026 |
| 0.2.3 | 22 | 10/01/2026 |
| 0.2.2 | 22 | 10/01/2026 |
| 0.2.1 | 24 | 10/01/2026 |
| 0.2.0 | 20 | 10/01/2026 |
| 0.1.2 | 23 | 10/01/2026 |
| 0.1.1 | 19 | 10/01/2026 |
| 0.1.0 | 21 | 10/01/2026 |
| 0.0.11 | 16 | 10/01/2026 |
| 0.0.11-preview-01 | 23 | 10/01/2026 |
| 0.0.10 | 29 | 10/01/2026 |
| 0.0.10-preview-03 | 22 | 10/01/2026 |
| 0.0.10-preview-02 | 22 | 10/01/2026 |
| 0.0.10-preview-01 | 24 | 10/01/2026 |
| 0.0.9 | 19 | 10/01/2026 |
| 0.0.8 | 23 | 10/01/2026 |
| 0.0.7 | 19 | 10/01/2026 |
| 0.0.6 | 18 | 10/01/2026 |
| 0.0.5 | 22 | 10/01/2026 |
| 0.0.4 | 25 | 10/01/2026 |
| 0.0.3 | 25 | 10/01/2026 |
| 0.0.2 | 19 | 10/01/2026 |
| 0.0.1 | 20 | 10/01/2026 |

