Typely.Core
8.0.0
dotnet add package Typely.Core --version 8.0.0
NuGet\Install-Package Typely.Core -Version 8.0.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="Typely.Core" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Typely.Core" Version="8.0.0" />
<PackageReference Include="Typely.Core" />
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 Typely.Core --version 8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Typely.Core, 8.0.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.
#:package Typely.Core@8.0.0
#: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=Typely.Core&version=8.0.0
#tool nuget:?package=Typely.Core&version=8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Typely: Unleashing the power of value object creation with a fluent Api.
Example
public class TypesSpecification : ITypelySpecification
{
public void Create(ITypelyBuilder builder)
{
builder.OfInt().For("Votes");
builder.OfString().For("Code").Length(4).NotEqual("0000");
builder.OfString()
.For("UserId")
.WithNamespace("UserAggregate")
.WithName("Owner identifier")
.NotEmpty()
.NotEqual("0").WithMessage("{Name} cannot be equal to {ComparisonValue}.").WithErrorCode("ERR001")
.MaxLength(20);
builder.OfString()
.For("Monday")
.AsClass()
.WithName(() => LocalizedNames.Moment)
.MinLength(1).WithMessage(() => LocalizedMessages.MinLengthCustom)
.MaxLength(20).WithMessage(() => LocalizedMessages.MaxLengthCustom);
}
}
Documentation
Prerequisites
- Supported .NET versions
- .NET 7.0 and greater
Getting started
Install packages
dotnet add package Typely.Core
dotnet add package Typely.Generators
Create a class inheriting from ITypelySpecification
public class TypesSpecification : ITypelySpecification
{
public void Create(ITypelyBuilder builder)
{
builder.OfString().For("FirstName").NotEmpty();
}
}
Usage
var firstName = FirstName.From("Adam");
FirstName.From(""); //Throws ValidationException
if(!FirstName.TryFrom("value", out FirstName instance, out ValidationError? validationError))
{
// Handle error
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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.
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Typely.Core:
| Package | Downloads |
|---|---|
|
Typely.AspNetCore.Swashbuckle
Package Description |
|
|
Typely.EfCore
Typely: Unleashing the power of value object creation with a fluent Api. This package contains integrations with EF Core. |
|
|
Typely.AspNetCore
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.0 | 375 | 6/8/2024 |
| 1.4.0 | 510 | 6/8/2024 |
| 1.3.0 | 1,124 | 5/10/2023 |
| 1.2.5-alpha | 704 | 4/28/2023 |
| 1.2.4-alpha | 639 | 4/28/2023 |
| 1.2.3-alpha | 597 | 4/26/2023 |
| 1.2.2-alpha | 704 | 4/23/2023 |
| 1.2.1-alpha | 582 | 4/19/2023 |
| 1.2.0-alpha | 1,589 | 4/16/2023 |
| 1.1.0-alpha | 1,673 | 4/15/2023 |
| 1.0.0-alpha | 568 | 4/15/2023 |
| 0.1.2-alpha | 559 | 1/18/2023 |
| 0.1.1-alpha | 784 | 1/18/2023 |
| 0.1.0-alpha | 579 | 1/16/2023 |