// Umbraco.Code.MapAll -Properties -Errors -Edited -Updater -Alias -IsContainer private void Map(IMedia source, MediaItemDisplay target, MapperContext context) { target.ContentApps = _commonMapper.GetContentAppsForEntity(source); target.ContentType = _commonMapper.GetContentType(source, context); target.ContentTypeId = source.ContentType.Id; target.ContentTypeAlias = source.ContentType.Alias; target.ContentTypeName = source.ContentType.Name; target.CreateDate = source.CreateDate; target.Icon = source.ContentType.Icon; target.Id = source.Id; target.IsChildOfListView = DetermineIsChildOfListView(source); target.Key = source.Key; target.MediaLink = string.Join(",", source.GetUrls(_contentSettings, _mediaUrlGenerators)); target.Name = source.Name; target.Owner = _commonMapper.GetOwner(source, context); target.ParentId = source.ParentId; target.Path = source.Path; target.SortOrder = source.SortOrder; target.State = null; target.Tabs = _tabsAndPropertiesMapper.Map(source, context); target.Trashed = source.Trashed; target.TreeNodeUrl = _commonTreeNodeMapper.GetTreeNodeUrl <MediaTreeController>(source); target.Udi = Udi.Create(Constants.UdiEntityType.Media, source.Key); target.UpdateDate = source.UpdateDate; target.VariesByCulture = source.ContentType.VariesByCulture(); }
// Umbraco.Code.MapAll -Properties -Errors -Edited -Updater -Alias -IsChildOfListView // Umbraco.Code.MapAll -Trashed -IsContainer -VariesByCulture private void Map(IMember source, MemberDisplay target, MapperContext context) { target.ContentApps = _commonMapper.GetContentAppsForEntity(source); target.ContentType = _commonMapper.GetContentType(source, context); target.ContentTypeId = source.ContentType.Id; target.ContentTypeAlias = source.ContentType.Alias; target.ContentTypeName = source.ContentType.Name; target.CreateDate = source.CreateDate; target.Icon = source.ContentType.Icon; target.Id = source.Id; target.Key = source.Key; target.Name = source.Name; target.Owner = _commonMapper.GetOwner(source, context); target.ParentId = source.ParentId; target.Path = source.Path; target.SortOrder = source.SortOrder; target.State = null; target.Tabs = _tabsAndPropertiesMapper.Map(source, context); target.TreeNodeUrl = _commonTreeNodeMapper.GetTreeNodeUrl <MemberTreeController>(source); target.Udi = Udi.Create(Constants.UdiEntityType.Member, source.Key); target.UpdateDate = source.UpdateDate; //Membership target.Username = source.Username; target.Email = source.Email; target.IsLockedOut = source.IsLockedOut; target.IsApproved = source.IsApproved; target.MembershipProperties = _tabsAndPropertiesMapper.MapMembershipProperties(source, context); }
// Umbraco.Code.MapAll -AllowPreview -Errors -PersistedContent private void Map <TVariant>(IContent source, ContentItemDisplay <TVariant> target, MapperContext context) where TVariant : ContentVariantDisplay { // Both GetActions and DetermineIsChildOfListView use parent, so get it once here // Parent might already be in context, so check there before using content service IContent?parent; if (context.Items.TryGetValue("Parent", out var parentObj) && parentObj is IContent typedParent) { parent = typedParent; } else { parent = _contentService.GetParent(source); } target.AllowedActions = GetActions(source, parent, context); target.AllowedTemplates = GetAllowedTemplates(source); target.ContentApps = _commonMapper.GetContentAppsForEntity(source); target.ContentTypeId = source.ContentType.Id; target.ContentTypeKey = source.ContentType.Key; target.ContentTypeAlias = source.ContentType.Alias; target.ContentTypeName = _localizedTextService.UmbracoDictionaryTranslate(_cultureDictionary, source.ContentType.Name); target.DocumentType = _commonMapper.GetContentType(source, context); target.Icon = source.ContentType.Icon; target.Id = source.Id; target.IsBlueprint = source.Blueprint; target.IsChildOfListView = DetermineIsChildOfListView(source, parent, context); target.IsContainer = source.ContentType.IsContainer; target.IsElement = source.ContentType.IsElement; target.Key = source.Key; target.Owner = _commonMapper.GetOwner(source, context); target.ParentId = source.ParentId; target.Path = source.Path; target.SortOrder = source.SortOrder; target.TemplateAlias = GetDefaultTemplate(source); target.TemplateId = source.TemplateId ?? default; target.Trashed = source.Trashed; target.TreeNodeUrl = _commonTreeNodeMapper.GetTreeNodeUrl <ContentTreeController>(source); target.Udi = Udi.Create(source.Blueprint ? Constants.UdiEntityType.DocumentBlueprint : Constants.UdiEntityType.Document, source.Key); target.UpdateDate = source.UpdateDate; target.Updater = _commonMapper.GetCreator(source, context); target.Urls = GetUrls(source); target.Variants = _contentVariantMapper.Map <TVariant>(source, context); target.ContentDto = new ContentPropertyCollectionDto { Properties = context.MapEnumerable <IProperty, ContentPropertyDto>(source.Properties).WhereNotNull() }; }