Click or drag to resize

ServiceHelper Class

Contains helpful methods for working with services and IServiceProvider.
Inheritance Hierarchy
System.Object
  AGI.Foundation.Infrastructure.ServiceHelper

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 25.1.421.0 (25.1.421.0)
Syntax
public static class ServiceHelper

The ServiceHelper type exposes the following members.

Methods
  NameDescription
Public methodStatic memberGetOptionalService<T>
Gets a service from a given service provider, or null if the service does not exist.
Public methodStatic memberGetService<T>(IServiceProvider)
Gets a service from a given service provider, throwing a ServiceNotAvailableException if the service is not available.
Public methodStatic memberGetService<T>(IServiceProvider, Boolean)
Gets a service from a given service provider.
Public methodStatic memberGetService<T>(IServiceProvider, String)
Gets a service from a given service provider, throwing a ServiceNotAvailableException if the service is not available.
Public methodStatic memberHasService
Checks whether a service provider has a given service.
Public methodStatic memberLocateService(Type, Object)
Convenience method for implementing IServiceProvider objects. If candidate is an instance of serviceType, returns candidate, otherwise returns null.
Public methodStatic memberLocateService<T>(Type, Object,T[])
Convenience method for implementing IServiceProvider objects. If candidate is an instance of serviceType, returns candidate. Otherwise, checks additional IServiceProvider objects for any that return a non-null result for serviceType. Otherwise, returns null.
Public methodStatic memberLocateService<T>(Type, Object, IEnumerable<T>)
Convenience method for implementing IServiceProvider objects. If candidate is an instance of serviceType, returns candidate. Otherwise, checks additional IServiceProvider objects for any that return a non-null result for serviceType. Otherwise, returns null.
Top
See Also