I have one entity which besides other information holds many images. This is one 2 many.
In situation where I need to load just first from that collection to slow loading I have following query which retrieve collection of images.
List<Entity> data = session.Query<Entity>()
.Fetch(x=>x.Photos)//here I need only first element
.Fetch(x=>x.Features)
.ToList();
Make use of
First()orFirstOrDefault()method of th linq wiil do task for youor
aslo read this before using this methods : When to use .First and when to use .FirstOrDefault with LINQ?