本文整理汇总了C#中IVertexType.GetBinaryPropertyDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# IVertexType.GetBinaryPropertyDefinition方法的具体用法?C# IVertexType.GetBinaryPropertyDefinition怎么用?C# IVertexType.GetBinaryPropertyDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVertexType
的用法示例。
在下文中一共展示了IVertexType.GetBinaryPropertyDefinition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateVertexUpdateDefinition
//.........这里部分代码省略.........
#region get update definitions
IDictionary<Int64, HyperEdgeUpdateDefinition> toBeUpdatedHyper = null;
IDictionary<Int64, SingleEdgeUpdateDefinition> toBeUpdatedSingle = null;
IDictionary<Int64, IComparable> toBeUpdatedStructured = null;
IDictionary<String, Object> toBeUpdatedUnstructured = null;
IDictionary<Int64, StreamAddDefinition> toBeUpdatedBinaries = null;
long? revision = null;
string edition = myUpdate.UpdatedEdition;
string comment = myUpdate.UpdatedComment;
#region property copy things
if (myPropertyCopy.StructuredProperties != null)
{
toBeUpdatedStructured = new Dictionary<long, IComparable>();
foreach (var prop in myPropertyCopy.StructuredProperties)
{
var propDef = myVertexType.GetPropertyDefinition(prop.Key);
CheckPropertyType(myVertexType.Name, prop.Value, propDef);
toBeUpdatedStructured.Add(propDef.ID, prop.Value);
}
}
toBeUpdatedUnstructured = myPropertyCopy.UnstructuredProperties;
#endregion
#region binary properties
if (myUpdate.UpdatedBinaryProperties != null)
{
foreach (var prop in myUpdate.UpdatedBinaryProperties)
{
var propDef = myVertexType.GetBinaryPropertyDefinition(prop.Key);
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)
示例2: CheckAddBinaryProperties
private static void CheckAddBinaryProperties(RequestInsertVertex myInsertDefinition, IVertexType vertexType)
{
foreach (var prop in myInsertDefinition.BinaryProperties)
{
var propertyDef = vertexType.GetBinaryPropertyDefinition(prop.Key);
if (propertyDef == null)
throw new AttributeDoesNotExistException(prop.Key, myInsertDefinition.VertexTypeName);
}
}