Skip to content

Property Handlers

Paul Stovell edited this page Apr 20, 2020 · 3 revisions

ℹ️ Property handlers aren't something you should typically need. A type handler might be more effective. Learn about the different ways to extend mapping in Nevermore.

After Nevermore uses TypeHandlers to convert the database result to a .NET object, it will assign it to a property on your class. This is typically done automatically, simply by calling the property getter/setters (even if the setters are non-public).

If you need custom logic for a particular property, you can implement IPropertyHandler. It's registered for each column:

Column(c => c.Items).CustomPropertyHandler(new MyPropertyHandler());

This is really only useful if you need to do some logic that's specific to a particular document, or you want to call something that isn't the property setter (perhaps a method on the class instead, or to get the existing value and change it).

Clone this wiki locally