Table of Contents

Class VehiclePlateAttribute

Namespace
HeroKit.Validation
Assembly
HeroKit.dll

Validates a vehicle plate of a country, for example [VehiclePlate("TR")].

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)]
public sealed class VehiclePlateAttribute : CountryValidationAttribute
Inheritance
VehiclePlateAttribute
Inherited Members
Extension Methods

Constructors

VehiclePlateAttribute(string)

Validates a vehicle plate of a country, for example [VehiclePlate("TR")].

public VehiclePlateAttribute(string countryCode)

Parameters

countryCode string

The ISO 3166-1 alpha-2 code.

Methods

IsValid(string, Country)

Validates a non-empty string with the rules of the country.

protected override bool IsValid(string value, Country country)

Parameters

value string

The value.

country Country

The resolved country.

Returns

bool

True if valid; otherwise false.