System.InvalidOperationException: Cannot register type Our.Umbraco.RedirectsViewer.Mapping.UserGroupProfile as it does not inherit from/implement Umbraco.Core.Persistence.Mappers.BaseMapper.
I am guessing I am not registering correctly, does anyone have an example of how to register custom mapper?
How to register mapper in v8
I have created a custom mapping as per https://our.umbraco.com/Documentation/Reference/Mapping/
The class is definition looks like:
I am trying to compose it as per the documentation:
So I have
This gives error:
I am guessing I am not registering correctly, does anyone have an example of how to register custom mapper?
Regards
Ismail
Have you tried inheriting from BaseMapper instead of IMapDefinition?
Damiaan,
Tried that and now the error moves to when i view my property editor:
Hi Ismail
I have struggled with the same thing today, and found that I got a bit further (although not 100% this is correct) when I replaced:
with
(leaving the interface for the UserGroupProfile to implement as
IMapDefinition
)Hope that helps? Once I've got this working completely I'll post to confirm. If so I'll look at maybe doing a PR to update the documentation.
Thanks
Emma
Just to note, the next issue I am encountering is
Don't know how to create X instances
where X is my target to map to.mapper.Define<Y, X>((source, context) => new X() { TestString = source.TestString; });
Sorted it, in terms of what to map. Now to customise what to map!
Hope changing the CollectionBuilder sorts it for you too
is working on a reply...