GetRequiredService Method
GetRequiredService<T>()
Gets a required service. Never returns null; instead a ServiceRequiredException is thrown when the service cannot be found.
Declaration
public T GetRequiredService<T>()
where T : class
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |