Unosquare
    Show / Hide Table of Contents

    Class ConstructorTypeCache

    A thread-safe cache of constructors belonging to a given type.

    Inheritance
    Object
    TypeCache<Tuple<ConstructorInfo, ParameterInfo[]>>
    ConstructorTypeCache
    Inherited Members
    TypeCache<Tuple<ConstructorInfo, ParameterInfo[]>>.Contains<TOut>()
    TypeCache<Tuple<ConstructorInfo, ParameterInfo[]>>.Retrieve<TOut>(Func<Type, IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>>>)
    Namespace: Swan.Reflection
    Syntax
    public class ConstructorTypeCache : TypeCache<Tuple<ConstructorInfo, ParameterInfo[]>>

    Properties

    DefaultCache

    Gets the default cache.

    Declaration
    public static Lazy<ConstructorTypeCache> DefaultCache { get; }
    Property Value
    Type Description
    Lazy<ConstructorTypeCache>

    The default cache.

    Methods

    RetrieveAllConstructors(Type, Boolean)

    Retrieves all constructors order by the number of parameters ascending.

    Declaration
    public IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>> RetrieveAllConstructors(Type type, bool includeNonPublic = false)
    Parameters
    Type Name Description
    Type type

    The type.

    Boolean includeNonPublic

    if set to true [include non public].

    Returns
    Type Description
    IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>>

    A collection with all the constructors in the given type.

    RetrieveAllConstructors<T>(Boolean)

    Retrieves all constructors order by the number of parameters ascending.

    Declaration
    public IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>> RetrieveAllConstructors<T>(bool includeNonPublic = false)
    Parameters
    Type Name Description
    Boolean includeNonPublic

    if set to true [include non public].

    Returns
    Type Description
    IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>>

    A collection with all the constructors in the given type.

    Type Parameters
    Name Description
    T

    The type to inspect.

    Comments

    Back to top Copyright © 2017-2019 Unosquare