fixed history->episode relationship.

This commit is contained in:
kay.one 2013-03-26 00:17:46 -07:00
commit a2b91b469e
3 changed files with 32 additions and 13 deletions

View file

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity<History.History>().RegisterModel("History")
.Relationships.AutoMapComplexTypeProperties<ILazyLoaded>()
.For(c => c.Episode)
.LazyLoad((db, history) => db.Query<Episode>().Where(ep => ep.Id == history.Id).ToList());
.LazyLoad((db, history) => db.Query<Episode>().Single(ep => ep.Id == history.EpisodeId));
Mapper.Entity<Series>().RegisterModel("Series")
.Relationships.AutoMapComplexTypeProperties<ILazyLoaded>()