Beispiel #1
0
 protected FieldType AddNavigationListField <TReturn>(
     string name,
     Func <ResolveFieldContext <TSource>, IEnumerable <TReturn> > resolve,
     Type graphType = null,
     IEnumerable <QueryArgument> arguments = null,
     IEnumerable <string> includeNames     = null)
     where TReturn : class
 {
     return(efGraphQlService.AddNavigationListField(this, name, resolve, graphType, arguments, includeNames));
 }
        static void AddNavigationList <TDbContext, TSource, TReturn>(
            ObjectGraphType <TSource> graph,
            IEfGraphQLService <TDbContext> graphQlService,
            Navigation navigation)
            where TDbContext : DbContext
            where TReturn : class
        {
            var graphTypeFromType = GraphTypeFromType(navigation.Name, navigation.Type, false);
            var compile           = NavigationExpression <TDbContext, TSource, IEnumerable <TReturn> >(navigation.Name).Compile();

            graphQlService.AddNavigationListField(graph, navigation.Name, compile, graphTypeFromType);
        }