public static List <ReferenceCategoryData> ConvertToData(IEnumerable <CategoryDto> referenceCategorys)
        {
            List <ReferenceCategoryData> result = new List <ReferenceCategoryData>();

            foreach (CategoryDto item in referenceCategorys)
            {
                result.Add(ReferenceCategoryInfoConverter.ConvertToData(item));
            }
            return(result);
        }
Пример #2
0
        public static ReferenceData ConvertToData(ReferenceInfoDto entity)
        {
            ReferenceData dto = new ReferenceData();

            dto.Id           = entity.ReferenceId;
            dto.Name         = entity.Name;
            dto.Slug         = entity.Slug != null ? entity.Slug : string.Empty;
            dto.Title        = entity.Title;
            dto.ThumbnailUrl = entity.ThumbnailUrl;
            dto.Description  = entity.Description;
            dto.Keywords     = entity.Keywords;
            dto.EnableAds    = entity.EnableAds;
            dto.EnableTopAd  = entity.EnableTopAd;
            dto.LocationId   = entity.LocationId;

            if (entity.ReferenceCategorys != null)
            {
                dto.ReferenceCategorys = ReferenceCategoryInfoConverter.ConvertToData(entity.ReferenceCategorys);
            }

            return(dto);
        }