Esempio n. 1
0
 protected FieldType AddNavigationField <TGraph, TReturn>(
     string name,
     Func <ResolveFieldContext <TSource>, TReturn> resolve,
     IEnumerable <QueryArgument> arguments = null,
     IEnumerable <string> includeNames     = null)
     where TGraph : ObjectGraphType <TReturn>
     where TReturn : class
 {
     return(efGraphQlService.AddNavigationField <TSource, TGraph, TReturn>(this, name, resolve, arguments, includeNames));
 }
Esempio n. 2
0
 protected FieldType AddNavigationField <TReturn>(
     string name,
     Func <ResolveFieldContext <TSource>, TReturn> resolve,
     Type graphType = null,
     IEnumerable <string> includeNames = null)
     where TReturn : class
 {
     return(efGraphQlService.AddNavigationField(this, name, resolve, graphType, includeNames));
 }
Esempio n. 3
0
        static void AddNavigation <TDbContext, TSource, TReturn>(
            ObjectGraphType <TSource> graph,
            IEfGraphQLService <TDbContext> graphQlService,
            Navigation navigation)
            where TDbContext : DbContext
            where TReturn : class
        {
            var graphTypeFromType = GraphTypeFromType(navigation.Name, navigation.Type, navigation.IsNullable);
            var compile           = NavigationExpression <TDbContext, TSource, TReturn>(navigation.Name).Compile();

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