Class GibInvoiceNumberAttribute
- Namespace
- HeroKit.Validation
- Assembly
- HeroKit.dll
Validates a Turkish e-Fatura or e-Arşiv invoice number (GİB format) with IsValidGibInvoiceNumber(string?).
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)]
public sealed class GibInvoiceNumberAttribute : ValidationAttribute
- Inheritance
-
GibInvoiceNumberAttribute
- Inherited Members
- Extension Methods
Examples
public sealed class Customer
{
[Required, GibInvoiceNumber]
public string? Value { get; set; }
}
Remarks
Null and empty values are valid; combine with RequiredAttribute to require a value. Non-string values are invalid.
Constructors
GibInvoiceNumberAttribute()
Initializes the attribute with the default error message: "The {0} field must be a valid e-invoice number (GİB format)."
public GibInvoiceNumberAttribute()
Methods
IsValid(object?)
Determines whether the specified value of the object is valid.
public override bool IsValid(object? value)
Parameters
valueobjectThe value of the object to validate.
Returns
Exceptions
- InvalidOperationException
The current attribute is malformed.
- NotImplementedException
Neither overload of
IsValidhas been implemented by a derived class.