Exemplo n.º 1
0
        /// <inheritdoc/>
        public async Task <IEnumerable <TreeNodeHeader> > GetChildNodeListAsync(EntityId idParent, DateTime?asOfUtc = null, ICacheParams cache = null)
        {
            //permission checks are performed in the child traverse loop down below
            var gop  = GdidOrPath.OfGNodeOrPath(idParent);
            var asof = DefaultAndAlignOnPolicyBoundary(asOfUtc, idParent);

            if (cache == null)
            {
                cache = CacheParams.DefaultCache;
            }

            IEnumerable <TreeNodeHeader> result;

            if (gop.PathAddress != null)
            {
                result = await getChildNodeListByTreePath(gop.Tree, gop.PathAddress, asof, cache).ConfigureAwait(false);
            }
            else
            {
                result = await getChildNodeListByGdid(gop.Tree, gop.GdidAddress, asof, cache).ConfigureAwait(false);
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public async Task <TreeNodeInfo> GetNodeInfoAsync(EntityId id, DateTime?asOfUtc = null, ICacheParams cache = null)
        {
            //permission checks are performed in the child traverse loop down below
            if (cache == null)
            {
                cache = CacheParams.DefaultCache;
            }
            var asof = DefaultAndAlignOnPolicyBoundary(asOfUtc, id);
            var gop  = GdidOrPath.OfGNodeOrPath(id);

            TreeNodeInfo result;

            if (gop.PathAddress != null)
            {
                result = await getNodeByTreePath(gop.Tree, gop.PathAddress, asof, cache).ConfigureAwait(false);
            }
            else
            {
                var graph = new HashSet <GDID>();
                result = await getNodeByGdid(graph, gop.Tree, gop.GdidAddress, asof, cache).ConfigureAwait(false);
            }

            return(result);
        }