Metalama 1.0 / / Metalama Documentation / Advanced API / Metalama.​Framework.​Engine.​Services / Service­Provider<TBase> / With­Service

Method WithService

WithService(TBase, Boolean)

Returns a new ServiceProvider<TBase> where a service have been added to the current ServiceProvider<TBase>. If the new service is already present in the current ServiceProvider<TBase>, it is replaced in the new ServiceProvider<TBase>.

Declaration
public ServiceProvider<TBase> WithService(TBase service, bool allowOverride = false)
Parameters
Type Name Description
TBase service
Boolean allowOverride
Returns
Type Description
ServiceProvider<TBase>