Map <PointerItem> to Organization

How do i use AutoMapper to map a PointerItem to an Organization?

My pointer is referencing an Organization, but i need to retrieve some data from that particular Organization.

This is what i’ve got so far.

.ForMember(x => x.Organization, m => m.MapFrom(organization => organization.GetValue<PointerItem>(BlockFieldNameConstants.OrganizationPointer).EntitySystemId.MapTo<Organization>()));

Should i create a resolver for this case?

You could create a resolver that fetches the information for the organization that you really want or you could do it in a builder.

In the latest Accelerator there’s an ImageModelResolver you could use as a basis.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.