Interface IRegistersMessageProviders
An object used to indicate which assemblies & types should be searched to find validation message providers.
Namespace: CSF.Validation.Bootstrap
Assembly: CSF.Validation.dll
Syntax
public interface IRegistersMessageProviders
Methods
| Improve this Doc View SourceAddMessageProvider(Type)
Adds a single validation message provider type to the the service collection, so that it may be dependency-injected.
Declaration
IRegistersMessageProviders AddMessageProvider(Type providerType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | providerType | The type of validation message provider to add to DI. |
Returns
| Type | Description |
|---|---|
| IRegistersMessageProviders | The registration helper, so that calls may be chained. |
Remarks
Use this method only when you wish to add individual message providers to dependency injection. It is usually more convenient to use one of the following methods to add message providers in bulk, using assembly-scanning techniques.
- AddMessageProvidersInAssembly(Assembly)
- AddMessageProvidersInAssemblies(Assembly[])
- AddMessageProvidersInAssemblies(IEnumerable<Assembly>)
This method also registers the message provider type so that it may be used with an IGetsCandidateMessageTypes.
AddMessageProvidersInAssemblies(IEnumerable<Assembly>)
Scans the specified assemblies for validation message providers and registers every one of
them, so that they may be dependency-injected.
Declaration
IRegistersMessageProviders AddMessageProvidersInAssemblies(IEnumerable<Assembly> assemblies)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Reflection.Assembly> | assemblies | A collection of assemblies to scan for validation message provider classes. |
Returns
| Type | Description |
|---|---|
| IRegistersMessageProviders | The registration helper, so that calls may be chained. |
Remarks
Use this method, AddMessageProvidersInAssembly(Assembly) or AddMessageProvidersInAssemblies(Assembly[]) as a convenient way to add many validation message providers to your dependency injection container.
This method also registers the found message provider types so that they may be used with an IGetsCandidateMessageTypes.
AddMessageProvidersInAssemblies(Assembly[])
Scans the specified assemblies for validation message providers and registers every one of
them, so that they may be dependency-injected.
Declaration
IRegistersMessageProviders AddMessageProvidersInAssemblies(params Assembly[] assemblies)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly[] | assemblies | A collection of assemblies to scan for validation message provider classes. |
Returns
| Type | Description |
|---|---|
| IRegistersMessageProviders | The registration helper, so that calls may be chained. |
Remarks
Use this method, AddMessageProvidersInAssembly(Assembly) or AddMessageProvidersInAssemblies(IEnumerable<Assembly>) as a convenient way to add many validation message providers to your dependency injection container.
This method also registers the found message provider types so that they may be used with an IGetsCandidateMessageTypes.
AddMessageProvidersInAssembly(Assembly)
Scans the specified assembly for validation message providers and registers every one of
them, so that they may be dependency-injected.
Declaration
IRegistersMessageProviders AddMessageProvidersInAssembly(Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | An assembly to scan for validation message provider classes. |
Returns
| Type | Description |
|---|---|
| IRegistersMessageProviders | The registration helper, so that calls may be chained. |
Remarks
Use this method, AddMessageProvidersInAssemblies(Assembly[]) or AddMessageProvidersInAssemblies(IEnumerable<Assembly>) as a convenient way to add many validation message providers to your dependency injection container.
This method also registers the found message provider types so that they may be used with an IGetsCandidateMessageTypes.