uMapper lets .NET developers map & query nodes as strongly typed objects with minimal configuration. It does its best to map the properties and relationships of a node to an object by name, but features a fluent interface for manual configuration in the much the same way AutoMapper does.
I’ve put together an example project with Umbraco 4.9.0 which shows example usage of uMapper. A SQLCE database is included as a file, and the username and password for the Umbraco back office are both “admin”.
Add a reference to uComponents.Mapping.dll
in your web project (this should already be added if you used NuGet to install uComponents).
Create your document types in Umbraco: Make sure you use CSV as the data format for any multi-node pickers you use.
Create your corresponding models as .NET classes in your project, naming the classes the same as the document type aliases:
ApplicationStartupHandler
and create your maps (these must be created before you start mapping nodes, or uMapper doesn’t know which classes to map to). Now is also a good time to enable caching (which uses the HttpContext.Current.Cache
):