Show / Hide Table of Contents

Interface IContainerResolver

Провайдер разрешения зависимостей.

Namespace:InfinniPlatform.IoC
Assembly:InfinniPlatform.Core.Abstractions.dll
Syntax
public interface IContainerResolver

Properties

| Improve this Doc View Source

Services

Возвращает список зарегистрированных сервисов.

Declaration
IEnumerable<Type> Services { get; }
Property Value
Type Description
IEnumerable<Type>

Methods

| Improve this Doc View Source

IsRegistered(Type)

Определяет, зарегистрирован ли сервис указанного типа.

Declaration
bool IsRegistered(Type serviceType)
Parameters
Type Name Description
Type serviceType

Тип сервиса.

Returns
Type Description
System.Boolean

Возвращает true, если сервис указанного типа зарегистрирован, иначе - false.

Examples

IsRegistered(typeof(IMyService))

| Improve this Doc View Source

IsRegistered<TService>()

Определяет, зарегистрирован ли сервис указанного типа.

Declaration
bool IsRegistered<TService>()where TService : class
Returns
Type Description
System.Boolean

Возвращает true, если сервис указанного типа зарегистрирован, иначе - false.

Type Parameters
Name Description
TService

Тип сервиса.

Examples

IsRegistered<IMyService>()

| Improve this Doc View Source

Resolve(Type)

Возвращает экземпляр сервиса.

Declaration
object Resolve(Type serviceType)
Parameters
Type Name Description
Type serviceType

Тип сервиса.

Returns
Type Description
System.Object

Экземпляр сервиса.

Remarks

Если сервис не был зарегистрирован, метод вернет исключение.

Examples

Resolve(typeof(IMyService))

| Improve this Doc View Source

Resolve<TService>()

Возвращает экземпляр сервиса.

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

Экземпляр сервиса.

Type Parameters
Name Description
TService

Тип сервиса.

Remarks

Если сервис не был зарегистрирован, метод вернет исключение.

Examples

Resolve<IMyService>()

| Improve this Doc View Source

ResolveOptional(Type)

Возвращает экземпляр сервиса, если он был зарегистрирован.

Declaration
object ResolveOptional(Type serviceType)
Parameters
Type Name Description
Type serviceType

Тип сервиса.

Returns
Type Description
System.Object

Экземпляр сервиса или null, если сервис не был зарегистрирован.

Examples

ResolveOptional(typeof(IMyService))

| Improve this Doc View Source

ResolveOptional<TService>()

Возвращает экземпляр сервиса, если он был зарегистрирован.

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

Экземпляр сервиса или null, если сервис не был зарегистрирован.

Type Parameters
Name Description
TService

Тип сервиса.

Examples

ResolveOptional<IMyService>()

| Improve this Doc View Source

TryResolve(Type, out Object)

Осуществляет попытку получения экземпляра сервиса.

Declaration
bool TryResolve(Type serviceType, out object serviceInstance)
Parameters
Type Name Description
Type serviceType

Тип сервиса.

System.Object serviceInstance

Экземпляр сервиса, если он был зарегистрирован, иначе null.

Returns
Type Description
System.Boolean
Examples

TryResolve(typeof(IMyService), out serviceInstance)

| Improve this Doc View Source

TryResolve<TService>(out TService)

Осуществляет попытку получения экземпляра сервиса.

Declaration
bool TryResolve<TService>(out TService serviceInstance)where TService : class
Parameters
Type Name Description
TService serviceInstance

Экземпляр сервиса, если он был зарегистрирован, иначе null.

Returns
Type Description
System.Boolean

Возвращает true, если сервис указанного типа зарегистрирован, иначе - false.

Type Parameters
Name Description
TService

Тип сервиса.

Examples

TryResolve<IMyService>(out serviceInstance)

Extension Methods

DynamicCollectionExtensions.GetItem(Object, Int32)
DynamicCollectionExtensions.SetItem(Object, Int32, Object)
DynamicCollectionExtensions.AddItem(Object, Object)
DynamicCollectionExtensions.InsertItem(Object, Int32, Object)
DynamicCollectionExtensions.RemoveItem(Object, Object)
DynamicCollectionExtensions.RemoveItemAt(Object, Int32)
DynamicCollectionExtensions.MoveItem(Object, Object, Int32)
DynamicObjectExtensions.TryGetPropertyValue(Object, String)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TryGetPropertyValueByPath(Object, String)
DynamicObjectExtensions.TrySetPropertyValueByPath(Object, String, Object)
ReflectionExtensions.IsInstanceOfType(Object, Type)
ReflectionExtensions.GetMemberValue(Object, String)
ReflectionExtensions.SetMemberValue(Object, String, Object)
ReflectionExtensions.InvokeMember(Object, String, Object[], out Object, Type[])
ReflectionExtensions.GetFieldValue(Object, FieldInfo)
ReflectionExtensions.SetFieldValue(Object, FieldInfo, Object)
ReflectionExtensions.GetPropertyValue(Object, PropertyInfo)
ReflectionExtensions.SetPropertyValue(Object, PropertyInfo, Object)
ReflectionExtensions.GetMethodDelegate(Object, MethodInfo)
ReflectionExtensions.GetEventDelegate(Object, EventInfo)
ReflectionExtensions.SetEventDelegate(Object, EventInfo, Object)
CommonExtensions.ExecuteSilent<T>(T, Action<T>)
  • Improve this Doc
  • View Source
Back to top © Copyright Infinnity Solutions Ltd, 2010–2017.