Ejemplo n.º 1
0
        private IMember MapDtoToContent(MemberDto dto)
        {
            var memberType = _memberTypeRepository.Get(dto.ContentDto.ContentTypeId);
            var member     = ContentBaseFactory.BuildEntity(dto, memberType);

            // get properties - indexed by version id
            var versionId  = dto.ContentVersionDto.Id;
            var temp       = new TempContent <Member>(dto.ContentDto.NodeId, versionId, 0, memberType);
            var properties = GetPropertyCollections(new List <TempContent <Member> > {
                temp
            });

            member.Properties = properties[versionId];

            // reset dirty initial properties (U4-1946)
            member.ResetDirtyProperties(false);
            return(member);
        }
Ejemplo n.º 2
0
    private IMedia MapDtoToContent(ContentDto dto)
    {
        IMediaType?contentType = _mediaTypeRepository.Get(dto.ContentTypeId);

        Core.Models.Media media = ContentBaseFactory.BuildEntity(dto, contentType);

        // get properties - indexed by version id
        var versionId = dto.ContentVersionDto.Id;
        var temp      = new TempContent <Core.Models.Media>(dto.NodeId, versionId, 0, contentType);
        IDictionary <int, PropertyCollection> properties =
            GetPropertyCollections(new List <TempContent <Core.Models.Media> > {
            temp
        });

        media.Properties = properties[versionId];

        // reset dirty initial properties (U4-1946)
        media.ResetDirtyProperties(false);
        return(media);
    }