Skip to content

ApplicationServicesContext.GetService<T> method

Returns the service, or null if it is not registered or the context has not been initialized yet.

public static T? GetService<T>()
    where T : class
parameter description
T The service type to resolve, normally an interface.

Return Value

The registered service instance, or null when the service is not registered or Current has not been set.

See Also