Ronald Barendse
07/13/2023, 4:44 PMIPublishedContent
in your package and get property values by alias (works out of the box, but doesn't allow you to use strongly typed models)
- Create custom model classes that inherit PublishedContentWrapped
and expose the required values as properties (requires you to wrap the content before passing it to your package Razor views)
- Create interfaces with the required properties and require users to extend their models with this type (allows you to use the interface for strongly typed model access and even allow users to update property names/types and 'map' them by changing the interface implementation)
If you really wanted, you could use the last option and a custom models generator implementation that writes the partial classes that adds the interface (in addition to the default generated models)...