I was wondering if there is any kind of lazy loading for a single attribute to increase the loading speed. I'm working with entity framwork 6.1.3 and the following model:
public class Photo : HoHoRecord
{
public string Description { get; set; }
public int? GalleryId { get; set; }
public virtual Gallery Gallery { get; set; }
public byte[] Thumbnail { get; set; }
public byte[] Content { get; set; }
public virtual BitmapImage ThumbnailBitmapImage
{
get
{
return ImageByteConverter.GetBitmapFromContentByteArray(Thumbnail);
}
}
public virtual BitmapImage ContentBitmapImage
{
get
{
return ImageByteConverter.GetBitmapFromContentByteArray(Content);
}
}
}
If I access the list of Photos in another model, I would prefer, that the attribute Photo.Content is not download yet. It should be downloaded only, when I access the property Photo.ContentBitmapImage.
This way I would be able increase the main loading speed of the whole liste in a good way.
Is there any way to achive this without creating an additional model class to store the byte array?
Thansk and regards
Markus