Link Search Menu Expand Document

PropertyHandlerCache


A cacher class for IPropertyHandler objects mapped to .NET CLR types or class properties. It uses PropertyHandlerMapper internally to extract results and caches them for future use.

Methods

Below are the methods available from this class.

FlushAllows you to flush the caches.
GetReturns the instance of the property handler.

Usability

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

Type Level

var propertyHandler = PropertyHandlerCache.Get<IntTypeProperHandler>(typeof(int));
// Use the 'propertyHandler' here

Or via generic type:

var propertyHandler = PropertyHandlerCache.Get<int, IntTypeProperHandler>();
// Use the 'propertyHandler' here

Property Level

var propertyHandler = PropertyHandlerCache.Get<Customer, CustomerAddressPropertyHandler>("Address");
// Use the 'propertyHandler' here

Or via expression:

var propertyHandler = PropertyHandlerCache.Get<Customer, CustomerAddressPropertyHandler>(e => e.Address);
// Use the 'propertyHandler' here