Exemplo n.º 1
0
 public static IQueryable <Node> OutLinkedNodes(this Node n, BrightStarDataContext <Node> dataContext,
                                                Func <Primitive?, bool> keySelector)
 {
     return(from outLinks in n.OutLinks(keySelector).AsQueryable()
            join likes in dataContext on outLinks.Iri equals likes.Id.Iri
            select likes);
 }
Exemplo n.º 2
0
 public static IQueryable <Node> OutLinkedNodes(this Node n, BrightStarDataContext <Node> dataContext,
                                                string key, int maxRecurse = 1)
 {
     return(maxRecurse > 1
         ? OutLinkedNodesRecursive(n, dataContext, x => x == key, maxRecurse)
         : OutLinkedNodes(n, dataContext, x => x == key));
 }
Exemplo n.º 3
0
        public IQueryable <T> Find(IEnumerable <NodeID> keys)
        {
            var dc = new BrightStarDataContext <T>((BrightStarDataProvider)Provider);

            ((IHaveKeys)dc).Keys = keys;
            ((IHaveQueryableElements)dc).Elements = ((BrightStarDataProvider)Provider).IndexQuery(keys);
            return(dc);
        }
Exemplo n.º 4
0
 public static IQueryable <Node> OutLinkedNodes(this IQueryable <Node> nodes,
                                                BrightStarDataContext <Node> dataContext,
                                                Func <Primitive?, bool> keySelector,
                                                int maxRecurse = 1)
 {
     return(maxRecurse > 1
             ? OutLinkedNodesRecursive(nodes, dataContext, keySelector, maxRecurse)
             : from n in nodes
            from y in n.OutLinkedNodes(dataContext, keySelector)
            select y);
 }
Exemplo n.º 5
0
 private static IQueryable <Node> OutLinkedNodesRecursive(this Node nodes,
                                                          BrightStarDataContext <Node> dataContext, Func <Primitive?, bool> keySelector, int maxRecurse)
 {
     return(nodes.TraverseQueryable(n => OutLinkedNodes(n, dataContext, keySelector), maxRecurse));
 }