Link Search Menu Expand Document

ClassMappedNameCache


A cacher class for class name mappings. It uses ClassMapper internally to extract results, then caches them for subsequent use, providing a second caching layer for class name mapping extraction.

Internally, this class is widely used within the library.

Methods

Below is the list of methods.

NameDescription
FlushAllows you to flush the caches.
GetReturns the mapped name of the class.

Usability

Call the Get() method by passing the class type:

var mappedName = ClassMappedNameCache.Get(typeof(Person));
// Use the 'mappedName' here

Or via generic type:

var mappedName = ClassMappedNameCache.Get<Person>();
// Use the 'mappedName' here

The extraction checks for the Map attribute first, then falls back to implicit mapping, and finally uses typeof(Class).Name from System.Reflection.