Class TaxIdAttribute
- Namespace
- HeroKit.Validation
- Assembly
- HeroKit.dll
Validates a tax identifier of a country, for example [TaxId("TR")] for a VKN or TCKN.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)]
public sealed class TaxIdAttribute : CountryValidationAttribute
- Inheritance
-
TaxIdAttribute
- Inherited Members
- Extension Methods
Constructors
TaxIdAttribute(string)
Validates a tax identifier of a country, for example [TaxId("TR")] for a VKN or TCKN.
public TaxIdAttribute(string countryCode)
Parameters
countryCodestringThe 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
Returns
- bool
True if valid; otherwise false.