Class ResourceErrorMessageSource
Reads error messages from .resx files: resource name = Code. The neutral file (Errors.resx) holds
English; each language adds its own (Errors.ar.resx, Errors.fr.resx).
Implements
Inherited Members
Namespace: ZhEaIsNsAaBn.Utilities
Assembly: ZhEaIsNsAaBn.LayerResponse.dll
Syntax
public sealed class ResourceErrorMessageSource : IErrorMessageSource
Examples
var source = new ResourceErrorMessageSource( AppErrors.ResourceManager ); // AppErrors = the .resx designer class
Constructors
ResourceErrorMessageSource(ResourceManager)
Creates the source.
Declaration
public ResourceErrorMessageSource(ResourceManager resourceManager)
Parameters
| Type | Name | Description |
|---|---|---|
| ResourceManager | resourceManager | The resources, e.g. the |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Methods
Find(string, CultureInfo)
The message for code in exactly culture — no fallback to parent cultures.
Declaration
public string? Find(string code, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | code | The error code, e.g. |
| CultureInfo | culture | The culture; InvariantCulture asks for the neutral (English) text. |
Returns
| Type | Description |
|---|---|
| string | The message template, or null when this source has none for that culture. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|