Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Interface IContainer

    Represents an interface for a dependency injection container.

    Inherited Members
    IDisposable.Dispose()
    Namespace: Innovt.Core.CrossCutting.Ioc
    Assembly: Innovt.Core.dll
    Syntax
    public interface IContainer : IDisposable
    Remarks

    This interface defines a contract for a dependency injection container that provides methods for registering modules, resolving services, releasing resources, and creating service scopes. It also includes a method for checking container configuration.

    Methods

    | Edit this page View Source

    AddModule(IocModule)

    Adds an IocModule to the container.

    Declaration
    void AddModule(IocModule iocModule)
    Parameters
    Type Name Description
    IocModule iocModule

    The IocModule to be added to the container.

    | Edit this page View Source

    CheckConfiguration()

    Checks the configuration of the container.

    Declaration
    void CheckConfiguration()
    | Edit this page View Source

    CreateScope()

    Creates and returns a new service scope.

    Declaration
    IServiceScope CreateScope()
    Returns
    Type Description
    IServiceScope

    An IServiceScope representing the new service scope.

    | Edit this page View Source

    Release(object)

    Releases the specified object and frees associated resources.

    Declaration
    void Release(object obj)
    Parameters
    Type Name Description
    object obj

    The object to release.

    | Edit this page View Source

    Resolve(Type)

    Resolves a service of the specified type.

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

    The Type of the service to resolve.

    Returns
    Type Description
    object

    The resolved service object.

    | Edit this page View Source

    Resolve<TService>()

    Resolves a service of type TService.

    Declaration
    TService Resolve<TService>()
    Returns
    Type Description
    TService

    The resolved service object.

    Type Parameters
    Name Description
    TService

    The type of service to resolve.

    | Edit this page View Source

    Resolve<TService>(string)

    Resolves a named instance of a service of type TService.

    Declaration
    TService Resolve<TService>(string instanceKey)
    Parameters
    Type Name Description
    string instanceKey

    The key identifying the named instance to resolve.

    Returns
    Type Description
    TService

    The resolved service object.

    Type Parameters
    Name Description
    TService

    The type of service to resolve.

    | Edit this page View Source

    Resolve<TService>(Type)

    Resolves a service of type TService with the specified type.

    Declaration
    TService Resolve<TService>(Type type)
    Parameters
    Type Name Description
    Type type

    The Type of the service implementation to resolve.

    Returns
    Type Description
    TService

    The resolved service object.

    Type Parameters
    Name Description
    TService

    The type of service to resolve.

    | Edit this page View Source

    TryToResolve<TService>()

    Try to resolve a service. If the service is not registered, return null.

    Declaration
    TService TryToResolve<TService>()
    Returns
    Type Description
    TService
    Type Parameters
    Name Description
    TService
    | Edit this page View Source

    TryToResolve<TService>(Type)

    This method will not throw an exception if the service is not registered. Return null instead.

    Declaration
    TService TryToResolve<TService>(Type type)
    Parameters
    Type Name Description
    Type type

    The type that you want to get an instance

    Returns
    Type Description
    TService

    Null or an instance of your type

    Type Parameters
    Name Description
    TService

    Extension Methods

    Extensions.IsNull(object)
    Extensions.ToStringOrDefault(object)
    SimpleMapper.MapTo<T1>(object)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX