# EntityScheme

Defines how to validate and present one family of entity values.

Class 

`OfficeIMO.Entities`

**Namespace**

`OfficeIMO.Entities`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[EntityScheme.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L59)

**Modifiers**

abstract

Defines how to validate and present one family of entity values.

## Inheritance

- object
- EntityScheme

## Usage

Explore 29 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 25

- Method [EntityCatalog.GetScheme](/api/core/officeimo-entities-entitycatalog/#method-getscheme-string)
- Property [EntityCatalog.Schemes](/api/core/officeimo-entities-entitycatalog/#property-schemes)
- Property [EntityMatch.Scheme](/api/core/officeimo-entities-entitymatch/#property-scheme)
- Property [EntityValidationResult.Scheme](/api/core/officeimo-entities-entityvalidationresult/#property-scheme)
- Method [EuVatSchemes.Get](/api/core/officeimo-entities-euvatschemes/#method-get-string)
- Property [EuVatSchemes.All](/api/core/officeimo-entities-euvatschemes/#property-all)
- Property [FinancialSchemes.Bic](/api/core/officeimo-entities-financialschemes/#property-bic)
- Property [FinancialSchemes.Card](/api/core/officeimo-entities-financialschemes/#property-card)
- Property [FinancialSchemes.Iban](/api/core/officeimo-entities-financialschemes/#property-iban)
- Property [FinancialSchemes.Isin](/api/core/officeimo-entities-financialschemes/#property-isin)
- Property [FinancialSchemes.Lei](/api/core/officeimo-entities-financialschemes/#property-lei)
- Property [IEntityRecognizer.Schemes](/api/core/officeimo-entities-ientityrecognizer/#property-schemes)
- Property [InternetSchemes.Email](/api/core/officeimo-entities-internetschemes/#property-email)
- Property [InternetSchemes.Url](/api/core/officeimo-entities-internetschemes/#property-url)
- Property [PolandSchemes.IdentityCard](/api/core/officeimo-entities-polandschemes/#property-identitycard)
- Property [PolandSchemes.Krs](/api/core/officeimo-entities-polandschemes/#property-krs)
- Property [PolandSchemes.Nip](/api/core/officeimo-entities-polandschemes/#property-nip)
- Property [PolandSchemes.Passport](/api/core/officeimo-entities-polandschemes/#property-passport)
- Property [PolandSchemes.Pesel](/api/core/officeimo-entities-polandschemes/#property-pesel)
- Property [PolandSchemes.Regon](/api/core/officeimo-entities-polandschemes/#property-regon)
- Property [UnitedKingdomSchemes.Company](/api/core/officeimo-entities-unitedkingdomschemes/#property-company)
- Property [UnitedKingdomSchemes.Nino](/api/core/officeimo-entities-unitedkingdomschemes/#property-nino)
- Property [UnitedKingdomSchemes.Vat](/api/core/officeimo-entities-unitedkingdomschemes/#property-vat)
- Property [UnitedStatesSchemes.Ein](/api/core/officeimo-entities-unitedstatesschemes/#property-ein)
- Property [UnitedStatesSchemes.Ssn](/api/core/officeimo-entities-unitedstatesschemes/#property-ssn)

### Accepted by parameters 4

- Method [EntityCatalog.TryGetScheme](/api/core/officeimo-entities-entitycatalog/#method-trygetscheme-string-officeimo-entities-entityscheme) parameter `scheme`
- Method [EntityCatalogBuilder.Add](/api/core/officeimo-entities-entitycatalogbuilder/#method-add-officeimo-entities-entityscheme-officeimo-entities-ientityrecognizer) parameter `scheme`
- Method [EntityRecognitionContext.IsEnabled](/api/core/officeimo-entities-entityrecognitioncontext/#method-isenabled-officeimo-entities-entityscheme) parameter `scheme`
- Constructor [EntityValidationResult.EntityValidationResult](/api/core/officeimo-entities-entityvalidationresult/#constructor-ctor-officeimo-entities-entityscheme-officeimo-entities-entityvalidationstatus-string-officeimo-entities-entitycheckoutcome-officeimo-entities-entitycheckinfo) parameter `scheme`

Filter members 

Show inherited

## Methods

`public virtual EntityDetails? Decode(string normalized)` [#](#method-decode-string)

[EntityScheme.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L76)

Returns the attributes encoded in a valid value, when supported.

Parameters

**normalized string required**

Returns

`EntityDetails?`

`public virtual string Format(string normalized, EntityFormatStyle style = Display)` [#](#method-format-string-officeimo-entities-entityformatstyle)

[EntityScheme.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L73)

Formats a canonical value for the requested use.

Parameters

**normalized string required**

**style OfficeIMO.Entities.EntityFormatStyle = Display optional**

Returns

`string`

`public bool IsValid(string? value)` [#](#method-isvalid-string)

[EntityScheme.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L59)

Checks whether a value passes local validation.

Parameters

**value string? required**

Returns

`bool`

`public virtual string MaskPartial(string normalized)` [#](#method-maskpartial-string)

[EntityScheme.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L80)

Masks a canonical value, preserving only the scheme's permitted display fragments.

Parameters

**normalized string required**

Returns

`string`

`public string? Normalize(string? value)` [#](#method-normalize-string)

[EntityScheme.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L69)

Returns the canonical value or null if validation fails.

Parameters

**value string? required**

Returns

`string?`

`public bool TryNormalize(string? value, out string normalized)` [#](#method-trynormalize-string-string)

[EntityScheme.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L63)

Returns the canonical value on successful validation.

Parameters

**value string? required**

**normalized string required**

Returns

`bool`

`public abstract EntityValidationResult Validate(string? value)` [#](#method-validate-string)

Checks written or normalized input without throwing for a malformed value.

Parameters

**value string? required**

Returns

`EntityValidationResult`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public abstract string Id { get; }` [#](#property-id)

Stable catalog identifier.

`public abstract EntityKind Kind { get; }` [#](#property-kind)

Category used for filtering and masking.

`public abstract string DisplayName { get; }` [#](#property-displayname)

Human-readable scheme name.

`public virtual string? Country { get; }` [#](#property-country)

[EntityScheme.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L19)

ISO 3166-1 alpha-2 country, or null for an international scheme.

`public virtual string? Issuer { get; }` [#](#property-issuer)

[EntityScheme.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L21)

Organization responsible for issuing or standardizing these values.

`public virtual Uri? Specification { get; }` [#](#property-specification)

[EntityScheme.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L23)

Documentation for the implemented format or check.

`public virtual int MinLength { get; }` [#](#property-minlength)

[EntityScheme.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L25)

Minimum normalized length in UTF-16 code units.

`public virtual int MaxLength { get; }` [#](#property-maxlength)

[EntityScheme.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L27)

Maximum normalized length in UTF-16 code units.

`public virtual EntityCheckKind Check { get; }` [#](#property-check)

[EntityScheme.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L29)

Check digit algorithm, if defined.

`public virtual IReadOnlyList<EntityCheckInfo> Checks { get; }` [#](#property-checks)

[EntityScheme.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L33)

Checks available for the supported formats and variants.

`public virtual EntitySensitivity Sensitivity { get; }` [#](#property-sensitivity)

[EntityScheme.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L49)

Default masking classification.

`public virtual IReadOnlyList<string> Contains { get; }` [#](#property-contains)

[EntityScheme.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityScheme.cs#L51)

Scheme identifiers that can appear inside this scheme's match.

<!-- PowerForge markdown artifact sha256:E41450808093AFEF009DB21C9EC4DD4B2B9DA69C4397B4F900A44A6040BD1A9B -->
