Exemple #1
0
        /*--------------------------------------------------------------------------------------------*/
        public T GetVertexById <T>(long pVertexId) where T : Vertex, new()
        {
            T item = vCache.FindVertex <T>(pVertexId);

            if (item != null)
            {
                return(item);
            }

            item          = new T();
            item.VertexId = pVertexId;

            IWeaverQuery q = Weave.Inst.Graph.V.ExactIndex(item).ToQuery();

            item = Build().AddQuery(q).Execute("GetVertexById").ToElement <T>();

            if (item == null)
            {
                vCache.RemoveVertex <T>(pVertexId);
            }
            else
            {
                vCache.AddVertex(item);
            }

            return(item);
        }