Share via


ServiceCollection.Get Method

Definition

Overloads

Get(Type)
Get(Type, Boolean)
Get<TService>()
Get<TService>(Boolean)

Get(Type)

public:
 System::Object ^ Get(Type ^ serviceType);
public object Get (Type serviceType);
member this.Get : Type -> obj
Public Function Get (serviceType As Type) As Object

Parameters

serviceType
Type

Returns

Applies to

Get(Type, Boolean)

public:
 System::Object ^ Get(Type ^ serviceType, bool ensureExists);
public object Get (Type serviceType, bool ensureExists);
member this.Get : Type * bool -> obj
Public Function Get (serviceType As Type, ensureExists As Boolean) As Object

Parameters

serviceType
Type
ensureExists
Boolean

Returns

Applies to

Get<TService>()

public:
generic <typename TService>
 TService Get();
public TService Get<TService> ();
member this.Get : unit -> 'Service
Public Function Get(Of TService) () As TService

Type Parameters

TService

Returns

TService

Applies to

Get<TService>(Boolean)

public:
generic <typename TService>
 TService Get(bool ensureExists);
public TService Get<TService> (bool ensureExists);
member this.Get : bool -> 'Service
Public Function Get(Of TService) (ensureExists As Boolean) As TService

Type Parameters

TService

Parameters

ensureExists
Boolean

Returns

TService

Applies to