Container.GetService<T>(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Searches for and returns the specified service.
public:
generic <typename T>
where T : class virtual T GetService(System::String ^ name);
public T GetService<T> (string name) where T : class;
abstract member GetService : string -> 'T (requires 'T : null)
override this.GetService : string -> 'T (requires 'T : null)
Public Function GetService(Of T As Class) (name As String) As T
Type Parameters
- T
The type of the service to search for.
Parameters
- name
- String
The name of the service to search for.
Returns
Type: {0}
The service.
Implements
Exceptions
The name
parameter is a null reference (Nothing in Visual Basic) or empty.
The container could not find a component with the specified name.