Class PropertyTypeCache
A thread-safe cache of properties belonging to a given type.
Inherited Members
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 |
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 |
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 |
Func<PropertyInfo, Boolean> | filter | The filter. |
Returns
Type | Description |
---|---|
IEnumerable<PropertyInfo> | A collection with all the properties in the given type. |