> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Ensure

> Provides methods for ensuring that method arguments meet specific criteria. This class provides a consistent way to validate arguments and throw appropriate ...

## Definition

**Assembly:** CloudNimble.EasyAF.Core.dll

**Namespace:** CloudNimble.EasyAF.Core

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.EasyAF.Core.Ensure
```

## Summary

Provides methods for ensuring that method arguments meet specific criteria.
This class provides a consistent way to validate arguments and throw appropriate exceptions.

## Examples

```csharp theme={"dark"}
public void ProcessData(string input, List&lt;string&gt; items)
{
    Ensure.ArgumentNotNull(input, nameof(input));
    Ensure.ArgumentNotNull(items, nameof(items));

    // Process the validated arguments
}
```

## Methods

### <Icon icon="thumbtack" iconType="duotone" color="#E0EC32" size={24} className="mr-2" /> ArgumentNotNull

Ensures that the specified argument is not null.

#### Syntax

```csharp theme={"dark"}
public static void ArgumentNotNull(object argument, string argumentName)
```

#### Parameters

| Name           | Type     | Description                               |
| -------------- | -------- | ----------------------------------------- |
| `argument`     | `object` | The argument to validate.                 |
| `argumentName` | `string` | The name of the argument being validated. |

#### Exceptions

| Exception               | Description                     |
| ----------------------- | ------------------------------- |
| `ArgumentNullException` | Thrown when *argument* is null. |

### <Icon icon="thumbtack" iconType="duotone" color="#E0EC32" size={24} className="mr-2" /> ArgumentNotNullOrWhiteSpace

Ensures that the specified argument is not null or whitespace.

#### Syntax

```csharp theme={"dark"}
public static void ArgumentNotNullOrWhiteSpace(string argument, string argumentName)
```

#### Parameters

| Name           | Type     | Description                               |
| -------------- | -------- | ----------------------------------------- |
| `argument`     | `string` | The argument to validate.                 |
| `argumentName` | `string` | The name of the argument being validated. |

#### Exceptions

| Exception           | Description                                   |
| ------------------- | --------------------------------------------- |
| `ArgumentException` | Thrown when *argument* is null or whitespace. |
