Method SetDefault
SetDefault(Func<CurrencyRegistry>)
Sets the registry that Default returns. This method must be called at application startup before the default registry is first accessed, i.e. before any currencies or monetary values are created that do not explicitly specify a registry.
Declaration
public static void SetDefault(Func<CurrencyRegistry> registryFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<CurrencyRegistry> | registryFactory | A function that creates the registry. It is invoked once, the first time Default is accessed. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The default registry has already been created. |
SetDefault(CurrencyRegistry)
Sets the registry that Default returns. This method must be called at application startup before the default registry is first accessed, i.e. before any currencies or monetary values are created that do not explicitly specify a registry.
Declaration
public static void SetDefault(CurrencyRegistry registry)
Parameters
| Type | Name | Description |
|---|---|---|
| CurrencyRegistry | registry | The registry to use as the default registry. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The default registry has already been created. |