A mapper class that is used to map the class into its equivalent object in the database (ie: Table, View). This class is used as an alternative to Map attribute.
Below are the methods available from this class.
Add- adds a mapping between the entity model and database object.
Clear- clears all the entity model and database object mappings.
Get- gets the mapped name of the entity model.
Remove- removes the exising mapping between the entity model identity and database object.
You should use this class if you do not like to use the Map attribute. Usually, the purpose of the usability is to make sure that the model is attribute-free and is not bound to a specific ORM.
How to Use?
To add a mapping, simply call the
An exception will be thrown if the mapping is already exists and you passed a
falsevalue in the
To get the mapping, use the
var mappedName = ClassMapper.Get<Customer>();
Please consider to always use the ClassMappedNameCache class when extracting the mapped class name.
To remove the mapping, use the