ServiceManager.GetRequiredService<TServiceType> メソッド

定義

要求したサービスを取得します。

public:
generic <typename TServiceType>
 TServiceType GetRequiredService();
public TServiceType GetRequiredService<TServiceType> ();
member this.GetRequiredService : unit -> 'ServiceType
Public Function GetRequiredService(Of TServiceType) () As TServiceType

型パラメーター

TServiceType

取得するサービスの型。

戻り値

TServiceType

サービスのインスタンスであるジェネリック型です。

例外

所定の型のサービスはありません。

注釈

GetService と異なり、このメソッドはサービスが使用できない場合に NotSupportedException をスローします。

適用対象