本文整理汇总了C#中IVertex.GetUnstructuredProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IVertex.GetUnstructuredProperty方法的具体用法?C# IVertex.GetUnstructuredProperty怎么用?C# IVertex.GetUnstructuredProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVertex
的用法示例。
在下文中一共展示了IVertex.GetUnstructuredProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateVertexUpdateDefinition
//.........这里部分代码省略.........
toBeUpdatedBinaries = toBeUpdatedBinaries ?? new Dictionary<long, StreamAddDefinition>();
toBeUpdatedBinaries.Add(propDef.ID, new StreamAddDefinition(propDef.ID, prop.Value));
}
}
#endregion
#region collections
if (myUpdate.AddedElementsToCollectionProperties != null || myUpdate.RemovedElementsFromCollectionProperties != null)
{
if (myUpdate.AddedElementsToCollectionProperties != null && myUpdate.RemovedElementsFromCollectionProperties != null)
{
var keys = myUpdate.AddedElementsToCollectionProperties.Keys.Intersect(myUpdate.RemovedElementsFromCollectionProperties.Keys);
if (keys.CountIsGreater(0))
{
//TOTO a better exception here
throw new Exception("You can not add and remove items simultaneously on a collection attribute.");
}
if (myUpdate.AddedElementsToCollectionProperties != null)
{
foreach (var added in myUpdate.AddedElementsToCollectionProperties)
{
var propDef = myVertexType.GetPropertyDefinition(added.Key);
var hasValue = (propDef == null)
? myVertex.HasUnstructuredProperty(added.Key)
: myVertex.HasProperty(propDef.ID);
//if it is not ICollectionWrapper something wrong with deserialization
var extractedValue = (!hasValue)
? null
: (propDef == null)
? myVertex.GetUnstructuredProperty<ICollectionWrapper>(added.Key)
: (ICollectionWrapper)propDef.GetValue(myVertex);
PropertyMultiplicity mult;
if (propDef != null)
{
//check types only for structured properties
foreach (var element in added.Value)
{
CheckPropertyType(myVertexType.Name, element, propDef);
}
mult = propDef.Multiplicity;
}
else
mult = (added.Value is SetCollectionWrapper)
? PropertyMultiplicity.Set
: PropertyMultiplicity.List;
var newValue = CreateNewCollectionWrapper(
(hasValue)
? extractedValue.Union(added.Value)
: added.Value,
mult);
if (propDef == null)
{
toBeUpdatedUnstructured = toBeUpdatedUnstructured ?? new Dictionary<String, object>();
toBeUpdatedUnstructured.Add(added.Key, newValue);
}
else
{
toBeUpdatedStructured = toBeUpdatedStructured ?? new Dictionary<long, IComparable>();