Typely.EfCore
1.0.0-alpha
This is a prerelease version of Typely.EfCore.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Typely.EfCore --version 1.0.0-alpha
NuGet\Install-Package Typely.EfCore -Version 1.0.0-alpha
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.EfCore" Version="1.0.0-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Typely.EfCore --version 1.0.0-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Typely.EfCore, 1.0.0-alpha"
#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 Typely.EfCore as a Cake Addin #addin nuget:?package=Typely.EfCore&version=1.0.0-alpha&prerelease // Install Typely.EfCore as a Cake Tool #tool nuget:?package=Typely.EfCore&version=1.0.0-alpha&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Typely lets you create types easily with a fluent API to embrace Domain-driven design and value objects.
Example
public class TypesConfiguration : ITypelyConfiguration
{
public void Configure(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 ITypelyConfiguration
public class TypesConfiguration : ITypelyConfiguration
{
public void Configure(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 | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Microsoft.EntityFrameworkCore (>= 7.0.5)
- Typely.Core (>= 1.2.0-alpha)
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 |
---|---|---|
8.0.0 | 76 | 6/8/2024 |
1.1.0 | 77 | 6/8/2024 |
1.0.4 | 157 | 5/10/2023 |
1.0.4-alpha | 97 | 4/28/2023 |
1.0.3-alpha | 110 | 4/28/2023 |
1.0.2-alpha | 96 | 4/25/2023 |
1.0.1-alpha | 97 | 4/23/2023 |
1.0.0-alpha | 99 | 4/16/2023 |