EXCSLA.Shared.Core.GuardClauses
5.3.1
dotnet add package EXCSLA.Shared.Core.GuardClauses --version 5.3.1
NuGet\Install-Package EXCSLA.Shared.Core.GuardClauses -Version 5.3.1
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="EXCSLA.Shared.Core.GuardClauses" Version="5.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EXCSLA.Shared.Core.GuardClauses" Version="5.3.1" />
<PackageReference Include="EXCSLA.Shared.Core.GuardClauses" />
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 EXCSLA.Shared.Core.GuardClauses --version 5.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EXCSLA.Shared.Core.GuardClauses, 5.3.1"
#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 EXCSLA.Shared.Core.GuardClauses@5.3.1
#: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=EXCSLA.Shared.Core.GuardClauses&version=5.3.1
#tool nuget:?package=EXCSLA.Shared.Core.GuardClauses&version=5.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EXCSLA.Shared.Core.GuardClauses
Guard clause extensions for input validation in the EXCSLA framework.
Overview
Provides fluent extension methods for guard clauses based on Ardalis.GuardClauses for clean, readable input validation.
Features
- Fluent API for input validation
- Clear error messages
- Prevents invalid state at entry points
- Based on Ardalis.GuardClauses design patterns
Installation
dotnet add package EXCSLA.Shared.Core.GuardClauses
Usage
using EXCSLA.Shared.Core.GuardClauses;
public class Order : AggregateRoot
{
public Order(OrderNumber orderNumber, Customer customer)
{
Guard.Against.Null(orderNumber, nameof(orderNumber));
Guard.Against.Null(customer, nameof(customer));
OrderNumber = orderNumber;
Customer = customer;
}
}
Common Guard Methods
- Guard.Against.Null() - Prevents null references
- Guard.Against.NullOrEmpty() - Prevents null or empty strings
- Guard.Against.NullOrWhiteSpace() - Prevents null, empty, or whitespace strings
- Guard.Against.InvalidInput() - Validates against predicates
- Guard.Against.OutOfRange() - Ensures values are within range
Dependencies
- .NET 10.0 or higher
- Ardalis.GuardClauses
License
See LICENSE file in repository
Support
For issues and questions, visit the GitHub repository
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- EXCSLA.Shared.Core.Abstractions (>= 5.3.1)
- EXCSLA.Shared.Core.Exceptions (>= 5.3.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EXCSLA.Shared.Core.GuardClauses:
| Package | Downloads |
|---|---|
|
EXCSLA.Shared.Core.ValueObjects.Common
Common Value Objects found in many domains. Such as Name, Email, Phone Number, etc. |
|
|
EXCSLA.Shared.Core.ValueObjects
Common Value Objects found in many domains. Such as Name, Email, Phone Number, etc. |
GitHub repositories
This package is not used by any popular GitHub repositories.