FluentDefaults 1.1.0
dotnet add package FluentDefaults --version 1.1.0
NuGet\Install-Package FluentDefaults -Version 1.1.0
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="FluentDefaults" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentDefaults --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FluentDefaults, 1.1.0"
#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.
// Install FluentDefaults as a Cake Addin #addin nuget:?package=FluentDefaults&version=1.1.0 // Install FluentDefaults as a Cake Tool #tool nuget:?package=FluentDefaults&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FluentDefaults
A library for .NET that uses a fluent interface for setting default values, similar to how FluentValidation handles validations. It promotes cleaner code, better separation of concerns, and integrates well with existing .NET frameworks.
Example:
public class PersonDefaulter : AbstractDefaulter<Person>
{
public PersonDefaulter()
{
DefaultFor(x => x.Id).Is(() => Guid.NewGuid());
DefaultFor(x => x.IsVip).Is(false);
DefaultFor(x => x.Discount).Is(20m).When(x => x.IsVip == true);
DefaultFor(x => x.Discount).Is(10m).When(x => x.IsVip == false);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has 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 |
---|---|---|
1.1.0 | 57 | 2/18/2025 |
1.0.0 | 102 | 2/8/2025 |
1.0.0-rc.7 | 48 | 1/27/2025 |
1.0.0-rc.6 | 36 | 1/23/2025 |
1.0.0-rc.5 | 38 | 1/22/2025 |
1.0.0-rc.4 | 34 | 1/21/2025 |
1.0.0-rc.3 | 34 | 1/20/2025 |
1.0.0-rc.2 | 55 | 1/6/2025 |
1.0.0-rc.1 | 65 | 1/1/2025 |
1.0.0-rc.0 | 62 | 12/31/2024 |
Add check for collections with deferred execution. Added extension methods for chaining