开发者

Problem using SetFetchMode in NHibernate

i have this method:

    public IEnumerable<Album> GetAllAlbumsWithTracks()
    {
        var albu开发者_Go百科ms = Session.CreateCriteria(typeof(Album))
            .SetFetchMode("Tracks", FetchMode.Eager)
            .SetResultTransformer(new DistinctRootEntityResultTransformer()).Future<Album>();

        return albums;
    }

but if i set .SetMaxResult(10) i get back 10 Tracks not Albums. how do i fix this?


try setting the fetch mode to join

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜