Open sandboxFocus

Method WithServices

WithServices(IEnumerable<TBase>?)

Returns a new ServiceProvider<TBase> where some given services have been added to the current ServiceProvider<TBase>. If some of the new services are already present in the current ServiceProvider<TBase>, they are replaced in the new ServiceProvider<TBase>.

Declaration
public ServiceProvider<TBase> WithServices(IEnumerable<TBase>? services)
Parameters
Type Name Description
IEnumerable<TBase> services
Returns
Type Description
ServiceProvider<TBase>

WithServices(TBase, params TBase[])

Returns a new ServiceProvider<TBase> where some given services have been added to the current ServiceProvider<TBase>. If some of the new services are already present in the current ServiceProvider<TBase>, they are replaced in the new ServiceProvider<TBase>.

Declaration
public ServiceProvider<TBase> WithServices(TBase service, params TBase[] services)
Parameters
Type Name Description
TBase service
TBase[] services
Returns
Type Description
ServiceProvider<TBase>