当前位置: 首页>>代码示例>>C#>>正文


C# IVertex.GetAllProperties方法代码示例

本文整理汇总了C#中IVertex.GetAllProperties方法的典型用法代码示例。如果您正苦于以下问题:C# IVertex.GetAllProperties方法的具体用法?C# IVertex.GetAllProperties怎么用?C# IVertex.GetAllProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVertex的用法示例。


在下文中一共展示了IVertex.GetAllProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveVertexPropertyFromIndex

        private void RemoveVertexPropertyFromIndex(IVertex aVertex, IIndexDefinition aIndexDefinition, IEnumerable<IIndex<IComparable, long>> myIndices, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            var entry = CreateIndexEntry(aIndexDefinition.IndexedProperties, aVertex.GetAllProperties().ToDictionary(key => key.Item1, value => value.Item2));

            foreach (var iIndex in myIndices)
            {
                if (iIndex is IMultipleValueIndex<IComparable, long>)
                {
                    lock (iIndex)
                    {
                        if (iIndex.ContainsKey(entry))
                        {
                            var toBeUpdatedIndex = (IMultipleValueIndex<IComparable, long>)iIndex;

                            var payLoad = toBeUpdatedIndex[entry];
                            payLoad.Remove(aVertex.VertexID);

                            toBeUpdatedIndex.Add(entry, payLoad, IndexAddStrategy.REPLACE);
                        }
                    }
                }
                else
                {
                    iIndex.Remove(entry);
                }

            }
        }
开发者ID:loubo,项目名称:sones,代码行数:28,代码来源:ExecuteVertexHandler.cs

示例2: CreateGraphDMLforIVertex

        private string CreateGraphDMLforIVertex(
            IVertexType myVertexType,
            IVertex myVertex,
            Dictionary<long, IPropertyDefinition> myPropertyDefinitions)
        {
            var stringBuilder = new StringBuilder();
            var delimiter = ", ";

            //INSERT INTO ... VALUES (VertexID = ...,
            stringBuilder.Append(String.Concat(S_INSERT.ToUpperString(),
                                                " ",
                                                S_INTO.ToUpperString(),
                                                " ",
                                                myVertexType.Name,
                                                " ",
                                                S_VALUES.ToUpperString(),
                                                " ",
                                                S_BRACKET_LEFT));

            stringBuilder.Append(String.Concat(S_UUID, " = ", myVertex.VertexID.ToString(), delimiter));

            #region standard attributes (creationDate, ...)

            string standardProperties = CreateGraphDMLforVertexStandardProperties(myVertex);

            stringBuilder.Append(standardProperties);

            #endregion

            #region properties (age, list<String>, ...)

            string defAttrsDML = CreateGraphDMLforDefinedProperties(myVertex.GetAllProperties(),
                                                                    myPropertyDefinitions);

            stringBuilder.Append(defAttrsDML);

            #endregion

            #region unstructured data

            string unstrProperties = CreateGraphDMLforVertexUnstructuredProperties(
                                        myVertex.GetAllUnstructuredProperties(),
                                        myPropertyDefinitions);

            stringBuilder.Append(unstrProperties);

            #endregion

            #region outgoing edges

            #region singleEdge

            string outgoingSingleEdges = CreateGraphDMLforVertexOutgoingSingleEdges(
                                            myVertexType,
                                            myVertex.GetAllOutgoingSingleEdges(),
                                            myVertexType.GetOutgoingEdgeDefinitions(true)
                                                .ToDictionary(key => key.ID, value => value));

            stringBuilder.Append(outgoingSingleEdges);

            #endregion

            #region hyperEdge

            string outgoingHyperEdges = CreateGraphDMLforVertexOutgoingHyperEdges
                                        (myVertexType,
                                        myVertex.GetAllOutgoingHyperEdges(),
                                        myVertexType.GetOutgoingEdgeDefinitions(true)
                                            .ToDictionary(key => key.ID, value => value));

            stringBuilder.Append(outgoingHyperEdges);

            #endregion

            #endregion

            if (stringBuilder.ToString().EndsWith(delimiter))
                stringBuilder.RemoveSuffix(delimiter);

            stringBuilder.Append(S_BRACKET_RIGHT);

            return stringBuilder.ToString();
        }
开发者ID:cosh,项目名称:sones,代码行数:83,代码来源:SonesGQLGrammar.cs


注:本文中的IVertex.GetAllProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。