ChatAIze.PerfectEmail
0.2.3
dotnet add package ChatAIze.PerfectEmail --version 0.2.3
NuGet\Install-Package ChatAIze.PerfectEmail -Version 0.2.3
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="ChatAIze.PerfectEmail" Version="0.2.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChatAIze.PerfectEmail --version 0.2.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ChatAIze.PerfectEmail, 0.2.3"
#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 ChatAIze.PerfectEmail as a Cake Addin #addin nuget:?package=ChatAIze.PerfectEmail&version=0.2.3 // Install ChatAIze.PerfectEmail as a Cake Tool #tool nuget:?package=ChatAIze.PerfectEmail&version=0.2.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Perfect Email
An easy-to-use, high-performance email validator for C# .NET 9.0 with custom attribute and disposable domain detection.
Installation
.NET CLI
dotnet add package ChatAIze.PerfectEmail
Package Manager Console
Install-Package ChatAIze.PerfectEmail
Usage
using ChatAIze.PerfectEmail;
bool isValidEmail = EmailValidator.IsValidEmail("someone@example.com");
Console.WriteLine(isValidEmail); // true
bool isDisposableEmail = DisposableEmailDetector.IsDisposableEmail("someone@0-mail.com");
Console.WriteLine(isDisposableEmail); // true
bool isDisposableEmailDomain = DisposableEmailDetector.IsDisposableEmailDomain("0-mail.com");
Console.WriteLine(isDisposableEmailDomain); // true
Attribute Usage
The Email
attribute performs address validation when the model is submitted. However, it does not check for disposable domains. An HTTP 400 Bad Request
status code is returned by default.
using ChatAIze.PerfectEmail;
namespace ChatAIze.ExampleAPI.Models;
public record AccountCreationRequest
{
[Email]
public required string Email { get; init; }
public required string Password { get; init; }
}
using ChatAIze.ExampleAPI.Models;
using Microsoft.AspNetCore.Mvc;
namespace ChatAIze.ExampleAPI.Controllers;
[ApiController]
[Route("api/[controller]")]
public sealed class AccountsController : ControllerBase
{
[HttpPost]
public IActionResult CreateAccount(AccountCreationRequest request)
{
Console.WriteLine($"Creating account for {request.Email}");
return NoContent();
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- 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.