Class ServiceCollectionExtensions
- Namespace
- CSF.Screenplay
- Assembly
- CSF.Screenplay.ReqnrollPlugin.dll
Extension methods for IServiceCollection.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
- Inherited Members
Methods
AddEnumerableAdapter<TService>(IServiceCollection)
Adds EnumerableResolutionAdapter<T> to the DI container for the service type TService.
public static IServiceCollection AddEnumerableAdapter<TService>(this IServiceCollection services) where TService : class
Parameters
servicesIServiceCollectionA service collection
Returns
- IServiceCollection
The same service collection, so calls may be chained
Type Parameters
TServiceThe service type for which to add the adapter
Remarks
This is required to work around a limitation of the BoDi DI container which ships with Reqnroll/SpecFlow. See EnumerableResolutionAdapter<T> for more information.
AddOptionsAdapters<TOptions>(IServiceCollection)
Adds enumerable adapters for service types which are required in order to enable the Microsoft Options Pattern with the specified options type.
public static IServiceCollection AddOptionsAdapters<TOptions>(this IServiceCollection services) where TOptions : class
Parameters
servicesIServiceCollectionA service collection
Returns
- IServiceCollection
The same service collection, so calls may be chained
Type Parameters
TOptionsThe options type
Remarks
This is required to work around a limitation of the BoDi DI container which ships with Reqnroll/SpecFlow. See EnumerableResolutionAdapter<T> for more information.
Use of the options pattern requires the resolution of three enumerable types: IConfigureOptions<TOptions>, IPostConfigureOptions<TOptions> and IValidateOptions<TOptions>. This method uses AddEnumerableAdapter<TService>(IServiceCollection) for each of those types.
AddScreenplayPlugin(IServiceCollection)
Adds the services to DI which are required to use the Reqnroll/SpecFlow plugin.
public static IServiceCollection AddScreenplayPlugin(this IServiceCollection services)
Parameters
servicesIServiceCollectionA service collection
Returns
- IServiceCollection
The same service collection, so calls may be chained