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

    Class BuilderServicesExtensions

    Extension methods for 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
    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
    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
    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
    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 for service of given type.

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

    Service collection to search in.

    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.