Link Search Menu Expand Document

PrimaryCache


A cacher class for the class primary property. Underneath, it uses the PrimaryMapper class to extract the results and caching it for future use.

Internally, this class is widely used within the library.

Methods

Below are the methods available from this class.

FlushAllows you to flush the caches.
GetReturns the list of Field objects.

Usability

You can simply call the Get() method of this class by passing the class type.

var primary = PrimaryCache.Get(typeof(Person));
// Use the 'primary' here

Or, via generic type.

var primary = PrimaryCache.Get<Person>();
// Use the 'primary' here

Internally, it uses the PrimaryMapper and PropertyCache classes to extract the list of ClassProperty and filter the result using the given IsPrimary() method.