Show / Hide Table of Contents

Class ServiceFactory

Defines a class that provides methods for getting metadata and creating instances of the configured dependency injection services.

Inheritance
System.Object
Singleton<ServiceFactory>
ServiceFactory
Inherited Members
Singleton<ServiceFactory>.Instance
Singleton<ServiceFactory>.ResetSingletonInstance()
Singleton<ServiceFactory>.SetSingletonInstance(ServiceFactory)
Singleton<ServiceFactory>.s_instance
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Juhta.Net.Services
Assembly: Juhta.Net.Services.dll
Syntax
public class ServiceFactory : Singleton<ServiceFactory>

Properties

| Improve this Doc View Source

Services

Gets an array of the Service instances created based on the configuration. The array is empty if there are no configured dependency injection services.

Declaration
public Service[] Services { get; }
Property Value
Type Description
Service[]

Methods

| Improve this Doc View Source

CreateService<TService>()

Creates an instance of a dependency injection service corresponding to a specified service type.

Declaration
public TService CreateService<TService>()where TService : class
Returns
Type Description
TService

Returns the created instance casted to the specified service type.

Type Parameters
Name Description
TService

Specifies a service type.

| Improve this Doc View Source

CreateService<TService>(ServiceId)

Creates an instance of a dependency injection service corresponding to a specified service identifier.

Declaration
public TService CreateService<TService>(ServiceId serviceId)where TService : class
Parameters
Type Name Description
ServiceId serviceId

Specifies a service identifier.

Returns
Type Description
TService

Returns the created instance casted to the specified service type.

Type Parameters
Name Description
TService

Specifies a service type.

| Improve this Doc View Source

CreateService<TService>(String)

Creates an instance of a dependency injection service corresponding to a specified service name.

Declaration
public TService CreateService<TService>(string serviceName)where TService : class
Parameters
Type Name Description
System.String serviceName

Specifies a service name.

Returns
Type Description
TService

Returns the created instance casted to the specified service type.

Type Parameters
Name Description
TService

Specifies a service type.

| Improve this Doc View Source

CreateService<TService>(String, String)

Creates an instance of a dependency injection service corresponding to a specified service identifier scheme and specifier.

Declaration
public TService CreateService<TService>(string serviceIdScheme, string serviceIdSpecifier)where TService : class
Parameters
Type Name Description
System.String serviceIdScheme

Specifies a service identifier scheme.

System.String serviceIdSpecifier

Specifies a service identifier specifier.

Returns
Type Description
TService

Returns the created instance casted to the specified service type.

Type Parameters
Name Description
TService

Specifies a service type.

  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX