Show / Hide Table of Contents

Interface IServiceFactory

Implements functionality to get services or instances from the composition container or as WCF proxy.

Namespace: Sartorius.SAF.ServiceLocation
Assembly: Sartorius.SAF.dll
Syntax
public interface IServiceFactory

Methods

View Source

CloseService(Object)

Closes the given services.

Declaration
void CloseService(object service)
Parameters
Type Name Description
System.Object service

The service to close.

View Source

GetInstance<T>(String)

Gets an instance of the given type.

Declaration
T GetInstance<T>(string name = null)
    where T : class
Parameters
Type Name Description
System.String name

The name.

Returns
Type Description
T

The service instance.

Type Parameters
Name Description
T
Exceptions
Type Condition
CommonServiceLocator.ActivationException

If instance not found.

View Source

GetInstanceOrDefault<T>(String)

Gets an instance of the given type.

Declaration
T GetInstanceOrDefault<T>(string name = null)
    where T : class
Parameters
Type Name Description
System.String name

The contract name.

Returns
Type Description
T

The service instance or null if not found.

Type Parameters
Name Description
T

A type of the service.

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
ServiceFactoryExtensions.Call<TService, TResult>(IServiceFactory, Func<TService, TResult>)
ServiceFactoryExtensions.Call<TService>(IServiceFactory, Action<TService>)
ServiceFactoryExtensions.CallAsync<TService, TResult>(IServiceFactory, Func<TService, TResult>)
ServiceFactoryExtensions.CallAsync<TService>(IServiceFactory, Action<TService>)
  • View Source
Back to top Generated by DocFX