Class PropertyValidationByMethodAttribute
Attribute for validating objects/properties by targeting functions within classes
the targeted function MUST ALWAYS RETURN A BOOLEAN
Inheritance
PropertyValidationByMethodAttribute
Assembly: LemonEdge.API.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple = true)]
public class PropertyValidationByMethodAttribute : ValidationAttribute
Constructors
PropertyValidationByMethodAttribute(Type, string, string)
Constructor takes in typeof(Class), nameof(Class.Method), and a error message
Declaration
public PropertyValidationByMethodAttribute(Type classType, string method, string message)
Parameters
Properties
TypeId
Declaration
public override object TypeId { get; }
Property Value
Overrides
Methods
IsValid(object, ValidationContext)
value is the object/property being validated it will be passed to the function that is stated in the attribute
the validation function should only take one parameter that is the object/property being validated
Declaration
protected override sealed ValidationResult IsValid(object value, ValidationContext validationContext)
Parameters
Returns
Overrides
Extension Methods