A cacher class for the class primary property. Underneath, it uses the PrimaryMapper class to extract the results and caching it for future use. It provides a 2nd-layer caching for the library when it comes to the class primary property extraction. As a result, the library is fast-enough when reusing the already extracted class primary property on any execution.
Internally, this class is widely used within the library.
Below are the methods available from this class.
Flush- allows you to flush the caches.
Get- returns the list of Field objects.
You should use this class if you would like to get the references of the class primary property in general purpose.
How to Use?
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