Table of Contents

ThrowIfNotGuid Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

ThrowIfNotGuid(string, GuidFormats, string, string)

Validates and throws an ArgumentException if the specified argument does not have the format of a Guid.

public static void ThrowIfNotGuid(string argument, GuidFormats format = GuidFormats.D | GuidFormats.B | GuidFormats.P, string message = "Value must be a Guid.", string paramName = null)

Parameters

argument string

The value to be evaluated.

format GuidFormats

A bitmask comprised of one or more GuidFormats that specify how the GUID parsing is conducted.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentException

argument must be a Guid.