Unosquare
    Show / Hide Table of Contents

    Class PropertyTypeCache

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

    Inheritance
    Object
    TypeCache<PropertyInfo>
    PropertyTypeCache
    Inherited Members
    TypeCache<PropertyInfo>.Contains<TOut>()
    TypeCache<PropertyInfo>.Retrieve<TOut>(Func<Type, IEnumerable<PropertyInfo>>)
    Namespace: Swan.Reflection
    Syntax
    public class PropertyTypeCache : TypeCache<PropertyInfo>

    Properties

    DefaultCache

    Gets the default cache.

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

    The default cache.

    Methods

    RetrieveAllProperties(Type, Boolean)

    Retrieves all properties.

    Declaration
    public IEnumerable<PropertyInfo> RetrieveAllProperties(Type type, bool onlyPublic = false)
    Parameters
    Type Name Description
    Type type

    The type.

    Boolean onlyPublic

    if set to true [only public].

    Returns
    Type Description
    IEnumerable<PropertyInfo>

    A collection with all the properties in the given type.

    RetrieveAllProperties<T>(Boolean)

    Retrieves all properties.

    Declaration
    public IEnumerable<PropertyInfo> RetrieveAllProperties<T>(bool onlyPublic = false)
    Parameters
    Type Name Description
    Boolean onlyPublic

    if set to true [only public].

    Returns
    Type Description
    IEnumerable<PropertyInfo>

    A collection with all the properties in the given type.

    Type Parameters
    Name Description
    T

    The type to inspect.

    RetrieveFilteredProperties(Type, Boolean, Func<PropertyInfo, Boolean>)

    Retrieves the filtered properties.

    Declaration
    public IEnumerable<PropertyInfo> RetrieveFilteredProperties(Type type, bool onlyPublic, Func<PropertyInfo, bool> filter)
    Parameters
    Type Name Description
    Type type

    The type.

    Boolean onlyPublic

    if set to true [only public].

    Func<PropertyInfo, Boolean> filter

    The filter.

    Returns
    Type Description
    IEnumerable<PropertyInfo>

    A collection with all the properties in the given type.

    Comments

    Back to top Copyright © 2017-2019 Unosquare