public override IGraphQlScalarResult <IEnumerable <Interfaces.Episode?> > AppearsIn() { return(this.Resolve(droid => from appearance in dbContext.Appearances where appearance.CharacterId == droid.Id orderby appearance.EpisodeId select(Interfaces.Episode?) DomainToInterface.ConvertEpisode(appearance.EpisodeId))); }
public override IGraphQlScalarResult <IEnumerable <Interfaces.Episode?> > AppearsIn() { // using a Join instead of inline Linq to show how reuse could be done return(this.Join(appearancesJoin).Resolve((human, appearances) => appearances.Select(appearance => (Interfaces.Episode?)DomainToInterface.ConvertEpisode(appearance.EpisodeId)))); }
public override IGraphQlScalarResult <Episode?> Episode() => this.Resolve(_ => (Episode?)DomainToInterface.ConvertEpisode(_.Episode));