Exemplo n.º 1
0
        public IEnumerable <ICharacter> Friends(ResolveFieldContext context)
        {
            var db = context.GetDataContext();

            return(db.Friendships
                   .Where(f => f.HumanId == HumanId)
                   .Select(f => f.Droid));
        }
Exemplo n.º 2
0
        public IEnumerable <Episode> AppearsIn(ResolveFieldContext context)
        {
            var db    = context.GetDataContext();
            var human = this;

            return(db.HumanAppearances
                   .Where(a => human.HumanId == a.HumanId)
                   .Select(a => a.Episode));
        }
Exemplo n.º 3
0
        public IEnumerable <Episode> AppearsIn(ResolveFieldContext context)
        {
            var db    = context.GetDataContext();
            var droid = (Droid)context.Source;

            return(db.DroidAppearances
                   .Where(a => droid.DroidId == a.DroidId)
                   .Select(a => a.Episode));
        }
Exemplo n.º 4
0
        public IEnumerable <Human> Humans(ResolveFieldContext context)
        {
            var db = context.GetDataContext();

            return(db.Humans.ToList());
        }
Exemplo n.º 5
0
        public IEnumerable <Droid> Droids(ResolveFieldContext context)
        {
            var db = context.GetDataContext();

            return(db.Droids.ToList());
        }