ServiceManager.GetRequiredService<TServiceType> Yöntem

Tanım

İstenen hizmeti alır.

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

Tür Parametreleri

TServiceType

Alınacak hizmet türü.

Döndürülenler

TServiceType

Hizmetin bir örneği olan genel bir tür.

Özel durumlar

Verilen türde bir hizmet yok.

Açıklamalar

'nin aksine GetService, hizmet kullanılamıyorsa bu yöntem bir NotSupportedException oluşturur.

Şunlara uygulanır