using Umbraco.Cms.Core.Mapping; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Api.Management.ViewModels.TrackedReferences; namespace Umbraco.Cms.Api.Management.Mapping.TrackedReferences; public class TrackedReferenceViewModelsMapDefinition : IMapDefinition { public void DefineMaps(IUmbracoMapper mapper) { mapper.Define((source, context) => new RelationItemViewModel(), Map); } // Umbraco.Code.MapAll private void Map(RelationItemModel source, RelationItemViewModel target, MapperContext context) { target.ContentTypeAlias = source.ContentTypeAlias; target.ContentTypeIcon = source.ContentTypeIcon; target.ContentTypeName = source.ContentTypeName; target.NodeKey = source.NodeKey; target.NodeName = source.NodeName; target.NodeType = source.NodeType; target.RelationTypeIsBidirectional = source.RelationTypeIsBidirectional; target.RelationTypeIsDependency = source.RelationTypeIsDependency; target.RelationTypeName = source.RelationTypeName; target.NodePublished = source.NodePublished; } }