Table of Contents

Class EmailNormalizer

Namespace
SEBT.Portal.Core.Utilities
Assembly
SEBT.Portal.Core.dll

Utility class for normalizing email addresses to ensure consistent storage and comparison.

public static class EmailNormalizer
Inheritance
object
EmailNormalizer

Methods

Normalize(string)

Normalizes an email address to lowercase and trims whitespace.

public static string Normalize(string email)

Parameters

email string

The email address to normalize.

Returns

string

The normalized (lowercase, trimmed) email address.

Exceptions

ArgumentException

Thrown when the email is null or whitespace.

NormalizeOrNull(string?)

Normalizes an email address to lowercase and trims whitespace, or returns null if the input is null or whitespace.

public static string? NormalizeOrNull(string? email)

Parameters

email string

The email address to normalize, or null/whitespace.

Returns

string

The normalized (lowercase, trimmed) email address, or null if the input was null or whitespace.