Skip to content

ServiceLocatorMixins.GetServiceWithContract(IServiceLocator, string?) method

Defined in

Type: ServiceLocatorMixins Namespace: ReactiveMarbles.Locator Assembly: ReactiveMarbles.ViewModel.Core.dll

Applies to

net8.0, net8.0-android34.0, net8.0-ios17.2, net8.0-windows10.0.19041, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, net8.0-maccatalyst17.2, netstandard2.0, net462

public static T GetServiceWithContract<T>(this IServiceLocator serviceLocator, string? contract = null)

View source

Summary: Gets the service.

Type parameters

NameDescription
TThe type.

Parameters

NameTypeDescription
serviceLocator[IServiceLocator](#The service locator.
contract = nullstring?The contract.

Returns: T -- An instance of T.

Exceptions

TypeCondition
System.ArgumentNullExceptionserviceLocator.