Bieber.Core.ValueObjects 1.0.2

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

Bieber.Core.ValueObjects

Bieber.Core.ValueObjects is a library for creating and managing value objects in your .NET applications. It provides a base implementation for value objects that are immutable and compared based on their properties.

Features

  • Base classes for value objects with one to five properties
  • Validation support using FluentValidation
  • Easy to extend and customize

Installation

Add the Bieber.Core.ValueObjects library to your project using the .NET CLI:

dotnet add package Bieber.Core.ValueObjects

Or add the package reference directly in your .csproj file:

<PackageReference Include="Bieber.Core.ValueObjects" Version="1.0.0" />

Usage

To create a value object, inherit from one of the base classes provided by the library and implement the required methods. For example:

using Bieber.Core.ValueObjects.Base; 
using FluentValidation;

public class EmailValueObject : ValidatedValueObject<string>
{ 
	public EmailValueObject(string value, bool throwExceptionOnFailure = true) 
	: base(value, throwExceptionOnFailure) 
	{ }

	protected override IEnumerable<IValidator<string>> RegisterValidators()
	{
		yield return new InlineValidator<string>()
			{
				v => v.RuleFor(x => x).EmailAddress()
			};
	}
}

License

This project is licensed under the MIT License. For more information, please see the LICENSE file. It also includes software under the Apache 2.0 License:

  • FluentValidation

Contributions

We welcome contributions to improve this library. Please fork the repository and submit pull requests with your changes.

Product 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.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.2 117 2/7/2025
1.0.1 105 2/7/2025