Class FieldTypeCache
A thread-safe cache of fields belonging to a given type The Retrieve method is the most useful one in this class as it calls the retrieval process if the type is not contained in the cache.
Inherited Members
Namespace: Swan.Reflection
Syntax
public class FieldTypeCache : TypeCache<FieldInfo>
Properties
DefaultCache
Gets the default cache.
Declaration
public static Lazy<FieldTypeCache> DefaultCache { get; }
Property Value
| Type | Description |
|---|---|
| Lazy<FieldTypeCache> | The default cache. |
Methods
RetrieveAllFields(Type)
Retrieves all fields.
Declaration
public IEnumerable<FieldInfo> RetrieveAllFields(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type. |
Returns
| Type | Description |
|---|---|
| IEnumerable<FieldInfo> | A collection with all the fields in the given type. |
RetrieveAllFields<T>()
Retrieves all fields.
Declaration
public IEnumerable<FieldInfo> RetrieveAllFields<T>()
Returns
| Type | Description |
|---|---|
| IEnumerable<FieldInfo> | A collection with all the fields in the given type. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to inspect. |