MetalamaAPI documentationAdvanced APIMetalama.​Framework.​Engine.​ServicesService­Provider<TBase>With­Service
Open sandboxFocus

ServiceProvider<TBase>.WithService Method

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>

WithService<T>(Func<ServiceProvider<TBase>, T>)

Declaration
public ServiceProvider<TBase> WithService<T>(Func<ServiceProvider<TBase>, T> func)
where T : class, TBase
Parameters
Type Name Description
Func<ServiceProvider<TBase>, T> func
Returns
Type Description
ServiceProvider<TBase>
Type Parameters
Name Description
T