Fixed: Bad Author -> Book lazy lookup

This commit is contained in:
ta264 2021-07-20 21:41:57 +01:00
parent 493ce1b20c
commit 0a20188508

View file

@ -102,7 +102,7 @@ public static void Map()
.HasOne(a => a.Metadata, a => a.AuthorMetadataId)
.HasOne(a => a.QualityProfile, a => a.QualityProfileId)
.HasOne(s => s.MetadataProfile, s => s.MetadataProfileId)
.LazyLoad(a => a.Books, (db, a) => db.Query<Book>(new SqlBuilder().Where<Book>(rg => rg.AuthorMetadataId == a.Id)).ToList(), a => a.Id > 0);
.LazyLoad(a => a.Books, (db, a) => db.Query<Book>(new SqlBuilder().Where<Book>(b => b.AuthorMetadataId == a.AuthorMetadataId)).ToList(), a => a.AuthorMetadataId > 0);
Mapper.Entity<Series>("Series").RegisterModel()
.Ignore(s => s.ForeignAuthorId)