ArgumentFilePathGuard.

ThrowIfFileNotExists(string, string) Method

Summary

Throws an System.IO.FileNotFoundException if filePath filepath not exists.

Syntax

public static string ThrowIfFileNotExists(this string filePath, string nameOfArgument)

Examples

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

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

Parameters

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

Return Value

Type Description
string
GitHub