Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class BuilderServicesExtensions

    Extension methods for Microsoft.Extensions.DependencyInjection.IServiceCollection and System.IServiceProvider used by builder classes.

    Inheritance
    System.Object
    BuilderServicesExtensions
    Namespace: TehGM.Wolfringo.Utilities.Internal
    Assembly: Wolfringo.Core.dll
    Syntax
    public static class BuilderServicesExtensions

    Methods

    | Improve this Doc View Source

    GetLoggerFor<TService>(IServiceProvider)

    Gets the most matching logger for a service.

    Declaration
    public static ILogger GetLoggerFor<TService>(this IServiceProvider services)
    Parameters
    Type Name Description
    System.IServiceProvider services

    Service provider to resolve logger from.

    Returns
    Type Description
    Microsoft.Extensions.Logging.ILogger

    The most matching logger found; can still return null if none was found.

    Type Parameters
    Name Description
    TService

    Service type.

    | Improve this Doc View Source

    GetLoggerFor<TService, TImplementation>(IServiceProvider)

    Gets the most matching logger for a service.

    Declaration
    public static ILogger GetLoggerFor<TService, TImplementation>(this IServiceProvider services)
        where TImplementation : TService
    Parameters
    Type Name Description
    System.IServiceProvider services

    Service provider to resolve logger from.

    Returns
    Type Description
    Microsoft.Extensions.Logging.ILogger

    The most matching logger found; can still return null if none was found.

    Type Parameters
    Name Description
    TService

    Service type.

    TImplementation

    Implementation type.

    | Improve this Doc View Source

    HasService<TService>(IServiceCollection)

    Checks if service of given type is added to service collection.

    Declaration
    public static bool HasService<TService>(this IServiceCollection services)
    Parameters
    Type Name Description
    Microsoft.Extensions.DependencyInjection.IServiceCollection services

    Service collection to search in.

    Returns
    Type Description
    System.Boolean

    True if service was found; otherwise false.

    Type Parameters
    Name Description
    TService

    Service type.

    | Improve this Doc View Source

    RemoveService<TService>(IServiceCollection)

    Removes a service of given type.

    Declaration
    public static void RemoveService<TService>(this IServiceCollection services)
    Parameters
    Type Name Description
    Microsoft.Extensions.DependencyInjection.IServiceCollection services

    Service collection to remove service from.

    Type Parameters
    Name Description
    TService

    Service type.

    | Improve this Doc View Source

    TryGetDescriptor<TService>(IServiceCollection, out ServiceDescriptor)

    Tries to get Microsoft.Extensions.DependencyInjection.ServiceDescriptor for service of given type.

    Declaration
    public static bool TryGetDescriptor<TService>(this IServiceCollection services, out ServiceDescriptor result)
    Parameters
    Type Name Description
    Microsoft.Extensions.DependencyInjection.IServiceCollection services

    Service collection to search in.

    Microsoft.Extensions.DependencyInjection.ServiceDescriptor result

    The found service descriptor.

    Returns
    Type Description
    System.Boolean

    True if service was found; otherwise false.

    Type Parameters
    Name Description
    TService

    Service type.