ArgumentDirectoryPathGuard.

ThrowIfDirectoryNotExists(string, string) Method

Summary

Throws an System.IO.DirectoryNotFoundException if directory path in directoryPath not exists.

Syntax

public static string ThrowIfDirectoryNotExists(this string directoryPath, string nameOfArgument)

Examples

Throws when the directory path in `argument` not exists.

var localVar = argument.ThrowIfDirectoryNotExists(nameof(argument));

Parameters

Name Type Description
directoryPath string Argument value.
nameOfArgument string Name of the argument.

Return Value

Type Description
string
GitHub