2
使用調用setFetchMode我有這樣的方法:問題NHibernate的
public IEnumerable<Album> GetAllAlbumsWithTracks()
{
var albums = Session.CreateCriteria(typeof(Album))
.SetFetchMode("Tracks", FetchMode.Eager)
.SetResultTransformer(new DistinctRootEntityResultTransformer()).Future<Album>();
return albums;
}
,但如果我設置.SetMaxResult(10)我回來10首歌曲沒有相冊。我該如何解決?
類似http://stackoverflow.com/questions/3221482/nhibernate-eager-loading-collections-paging? – David 2011-01-18 21:48:05