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.
| Name | Description |
|---|---|
| Flush | Allows you to flush the caches. |
| Get | Returns 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).NamefromSystem.Reflection.