CoreConcerns.Validation 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CoreConcerns.Validation --version 1.0.0
NuGet\Install-Package CoreConcerns.Validation -Version 1.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="CoreConcerns.Validation" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CoreConcerns.Validation --version 1.0.0
#r "nuget: CoreConcerns.Validation, 1.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.
// Install CoreConcerns.Validation as a Cake Addin
#addin nuget:?package=CoreConcerns.Validation&version=1.0.0

// Install CoreConcerns.Validation as a Cake Tool
#tool nuget:?package=CoreConcerns.Validation&version=1.0.0

Certainly! Below is a README template that you can use for both GitHub and NuGet.org for your CoreConcerns.Validation library. It provides an overview, installation instructions, examples of usage, and contribution guidelines. Make sure to fill in or adjust any sections with <> to include the actual content that is relevant to your project.


CoreConcerns.Validation

Overview

CoreConcerns.Validation is a comprehensive validation library for .NET, built on top of FluentValidation, designed to simplify the addition of complex validation logic to your applications. It extends FluentValidation with custom validation rules, making it easy to validate phone numbers, email addresses, and other common data formats.

Features

  • Validate phone numbers with country-specific formats.
  • Enforce email addresses to conform to specific domains.
  • Extend FluentValidation with more complex custom rules.

Installation

Install CoreConcerns.Validation using NuGet:

dotnet add package CoreConcerns.Validation

Or via the NuGet package manager console:

Install-Package CoreConcerns.Validation

Usage

Here's how to implement custom validation for unique country phone numbers and emails with a specified domain:

public class MyValidator : AbstractValidator<MyModel>
{
    public MyValidator()
    {
        RuleFor(x => x.PhoneNumber).NigerianPhoneNumber();
        RuleFor(x => x.Email).ValidEmailAddress("example.com");
        // Additional rules...
    }
}

Examples

Validate a Nigerian Phone Number

public class UserValidator : AbstractValidator<User>
{
    public UserValidator()
    {
        RuleFor(user => user.PhoneNumber).NigerianPhoneNumber();
    }
}

Validate an Email Address with a Specific Domain

public class CustomerValidator : AbstractValidator<Customer>
{
    public CustomerValidator()
    {
        RuleFor(customer => customer.Email).ValidEmailAddress("mydomain.com");
    }
}

Contributing

Contributions to CoreConcerns.Validation are welcome! If you have suggestions or improvements, please submit an issue or pull request on GitHub.

License

CoreConcerns.Validation is licensed under the MIT License. See the LICENSE file in the GitHub repository for more details.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.

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 171 12/19/2023
1.0.1 93 12/19/2023
1.0.0 82 12/19/2023