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
<PackageReference Include="Bieber.Core.ValueObjects" Version="1.0.2" />
<PackageVersion Include="Bieber.Core.ValueObjects" Version="1.0.2" />
<PackageReference Include="Bieber.Core.ValueObjects" />
paket add Bieber.Core.ValueObjects --version 1.0.2
#r "nuget: Bieber.Core.ValueObjects, 1.0.2"
#:package Bieber.Core.ValueObjects@1.0.2
#addin nuget:?package=Bieber.Core.ValueObjects&version=1.0.2
#tool nuget:?package=Bieber.Core.ValueObjects&version=1.0.2
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 | 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. 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. |
-
net9.0
- Bieber.Core.Helpers (>= 1.0.1)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.