I am using Glass library as ORM for Sitecore. I have a field Images which contains the list of images. Since I want to access this from my .NET code, I have written a partial class which has the field images like:
[SitecoreField]
public virtual IEnumerable<Glass.Sitecore.Mapper.FieldTypes.Image> Images { get; set;}
But while loading this I am getting error.
The method or operation is not implemented.
Where as I am able to access the single image through Glass, without writing any additional code.
Can anyone please suggest something to fix this?
Our architect has solved this issue with the help of creator of Glass library. And the solution is like this..
[SitecoreField]
public virtual IEnumerable<MediaImage> Images { get; set;}
And Media Image is class like:
[SitecoreClass]
public class MediaImage
{
[SitecoreField("Attachment")]
public virtual Stream Image { get; set; }
[SitecoreInfo(SitecoreInfoType.MediaUrl)]
public virtual string Url { get; set; }
[SitecoreField("Alt")]
public virtual string Alt { get; set; }
}
This has solved the issue and I am getting the list of images now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With