public static LinkItemCollection GetPropertyValue <TContentItem>(this TContentItem contentItem, Expression <Func <TContentItem, LinkItemCollection> > expression)
            where TContentItem : ContentItem
        {
            MemberExpression memberExpression = GetMemberExpression(expression);

            return(LinkItemCollection.FindByPageAndPropertyName(contentItem, memberExpression.Member.Name));
        }
        public override void UpdateEditor(global::N2.ContentItem item, Control editor)
        {
            LinkItemCollection coll = LinkItemCollection.FindByPageAndPropertyName(item, Name);

            ImageGalleryControl ctrl = ((ImageGalleryControl)editor);

            IDynamicImageUtility dynamicImageUtility = GetDynamicImageUtility();

            //Need to convert the ImageItem objects to ImageGalleryItemEditDTO objects
            List <ImageGalleryItemEditDTO> lstImageGalleryItemEditDTO = coll.Cast <ImageItem>().Select(x =>
            {
                var dto          = ImageGalleryAutoMapperMappings.Instance.Map <ImageGalleryItemEditDTO>(x);
                dto.ThumbnailUrl = VirtualPathUtility.ToAppRelative(dynamicImageUtility.GenerateVirtualPath(dto.Url, new DynamicImageOptions(dto.Url, 150, 150, DynamicResizeMode.UniformFill, DynamicImageFormat.Jpeg)));

                return(dto);
            }).ToList();

            ctrl.Initialize(JsonConvert.SerializeObject(lstImageGalleryItemEditDTO), coll.Count);
        }