Class DirectoryExistsOrCreateAttribute
Validates that if the user specifies a value for a property that the value represents a directory that exists as determined by System.IO.Directory.Exists(directory).
Inherited Members
Namespace: AnalysisPrograms.Production.Validation
Assembly: AnalysisPrograms.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class DirectoryExistsOrCreateAttribute : ValidationAttribute
Constructors
| Improve this Doc View SourceDirectoryExistsOrCreateAttribute(Boolean, Boolean)
Declaration
public DirectoryExistsOrCreateAttribute(bool createIfNotExists = false, bool shouldExist = true)
Parameters
Methods
| Improve this Doc View SourceIsValid(Object, ValidationContext)
Validates that the given directory exists.
Declaration
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
Parameters
Type | Name | Description |
---|---|---|
Object | value | |
Validation |
validationContext |
Returns
Type | Description |
---|---|
Validation |