本文整理汇总了C#中DBObjectStream.GetUndefinedAttributePayload方法的典型用法代码示例。如果您正苦于以下问题:C# DBObjectStream.GetUndefinedAttributePayload方法的具体用法?C# DBObjectStream.GetUndefinedAttributePayload怎么用?C# DBObjectStream.GetUndefinedAttributePayload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObjectStream
的用法示例。
在下文中一共展示了DBObjectStream.GetUndefinedAttributePayload方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadUndefAttributes
protected Exceptional<IDictionary<String, IObject>> LoadUndefAttributes(String myName, DBContext dbContext, DBObjectStream myObjStream)
{
var loadExcept = myObjStream.GetUndefinedAttributePayload(dbContext.DBObjectManager);
if (loadExcept.Failed())
return new Exceptional<IDictionary<string, IObject>>(loadExcept);
return new Exceptional<IDictionary<string, IObject>>(loadExcept.Value);
}
示例2: Update
/// <summary>
/// <seealso cref=" AAttributeAssignOrUpdateOrRemove"/>
/// </summary>
public override Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>> Update(DBContext myDBContext, DBObjectStream myDBObjectStream, GraphDBType myGraphDBType)
{
Dictionary<String, Tuple<TypeAttribute, IObject>> attrsForResult = new Dictionary<String, Tuple<TypeAttribute, IObject>>();
#region AttributeRemove
#region divide remove list in undefined and defined attributes
var undefAttrsExcept = myDBObjectStream.GetUndefinedAttributePayload(myDBContext.DBObjectManager);
if (undefAttrsExcept.Failed())
{
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(undefAttrsExcept);
}
var undefAttrsOfObject = undefAttrsExcept.Value;
var undefAttrsToRemove = ToBeRemovedAttributes.Where(item => undefAttrsOfObject.ContainsKey(item)).ToList();
List<String> defAttrsToRemove = new List<String>();
List<String> unknowAttrs = new List<String>();
foreach (var item in ToBeRemovedAttributes.Where(item => !undefAttrsOfObject.ContainsKey(item)).ToList())
{
if (myGraphDBType.GetTypeAttributeByName(item) != null)
defAttrsToRemove.Add(item);
else
unknowAttrs.Add(item);
}
#endregion
#region remove undefined attributes
if (!unknowAttrs.IsNullOrEmpty())
{
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(new Error_InvalidUndefinedAttributes(unknowAttrs));
}
foreach (var aAttribute in undefAttrsToRemove)
{
var removeExcept = myDBContext.DBObjectManager.RemoveUndefinedAttribute(aAttribute, myDBObjectStream);
if (removeExcept.Failed())
{
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(removeExcept);
}
attrsForResult.Add(aAttribute, new Tuple<TypeAttribute, IObject>(new UndefinedTypeAttribute(aAttribute), null));
}
//if (!undefAttrsToRemove.IsNullOrEmpty())
// sthChanged = true;
#endregion
#region RemoveAttribute
var applyRemoveResult = ApplyRemoveAttribute(defAttrsToRemove, myDBContext, myDBObjectStream, myGraphDBType);
if (applyRemoveResult.Failed())
{
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(applyRemoveResult);
}
if (applyRemoveResult.Value.Count > 0)
{
//sthChanged = true;
#region Add to queryResult
foreach (var attr in applyRemoveResult.Value)
{
attrsForResult.Add(attr.Name, new Tuple<TypeAttribute, IObject>(attr, null));
}
#endregion
}
#endregion
#endregion
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(attrsForResult);
}
示例3: CreateGraphDMLforDBObject
private Exceptional<String> CreateGraphDMLforDBObject(DumpFormats myDumpFormat, DBContext myDBContext, GraphDBType myGraphDBType, DBObjectStream myDBObjectStream)
{
var stringBuilder = new StringBuilder();
var delimiter = ", ";
stringBuilder.Append(String.Concat(S_INSERT.ToUpperString(), " ", S_INTO.ToUpperString(), " ", myGraphDBType.Name, " ", S_VALUES.ToUpperString(), " ", S_BRACKET_LEFT));
stringBuilder.Append(String.Concat(S_UUID.ToUpperString(), " = '", myDBObjectStream.ObjectUUID.ToString(), "'", delimiter));
#region CreateGraphDMLforDBODefinedAttributes
var defAttrsDML = CreateGraphDMLforDBObjectDefinedAttributes(myDumpFormat, myDBObjectStream.GetAttributes(), myGraphDBType, myDBObjectStream, myDBContext);
if (!defAttrsDML.Success())
{
return defAttrsDML;
}
stringBuilder.Append(defAttrsDML.Value);
#endregion
#region CreateGDMLforDBOUnDefinedAttributes
var undefAttrs = myDBObjectStream.GetUndefinedAttributePayload(myDBContext.DBObjectManager);
if (!undefAttrs.Success())
{
return new Exceptional<String>(undefAttrs);
}
if (undefAttrs.Value.Count > 0)
{
Exceptional<String> undefAttrsDML = CreateGraphDMLforDBObjectUndefinedAttributes(myDumpFormat, undefAttrs.Value, myGraphDBType, myDBObjectStream);
if (!undefAttrsDML.Success())
{
return undefAttrsDML;
}
stringBuilder.Append(undefAttrsDML.Value);
}
#endregion
stringBuilder.RemoveSuffix(delimiter);
stringBuilder.Append(S_BRACKET_RIGHT);
return new Exceptional<String>(stringBuilder.ToString());
}
示例4: AddAttributesByDBO
//.........这里部分代码省略.........
}
else
{
myAttributes.Add(typeAttr.Name, GetNotResolvedReferenceAttributeValue(myDBObject, typeAttr, myType, myEdgeList, myUsingGraph, _DBContext));
}
}
#endregion
}
else
{
throw new GraphDBException(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
}
}
#endregion
#region Get all backwardEdge attributes
if (mySelType == TypesOfSelect.Minus || mySelType == TypesOfSelect.Asterisk || mySelType == TypesOfSelect.Ad || mySelType == TypesOfSelect.Lt)
{
foreach (var beAttr in GetBackwardEdgeAttributes(myType))
{
if (myDepth > 0)
{
if (mySelType == TypesOfSelect.Ad)
{
if (beAttr.BackwardEdgeDefinition.TypeUUID != myTypeID)
{
continue;
}
}
var bes = myDBObject.GetBackwardEdges(beAttr.BackwardEdgeDefinition, _DBContext, _DBContext.DBObjectCache, beAttr.GetDBType(_DBContext.DBTypeManager));
if (bes.Failed())
throw new GraphDBException(bes.IErrors);
if (bes.Value != null) // otherwise the DBO does not have any
myAttributes.Add(beAttr.Name, ResolveAttributeValue(beAttr, bes.Value, myDepth, myEdgeList, myDBObject, myReference, myUsingGraph));
}
else
{
if (mySelType == TypesOfSelect.Ad)
{
if (beAttr.BackwardEdgeDefinition.TypeUUID != myTypeID)
{
continue;
}
}
var notResolvedBEs = GetNotResolvedBackwardEdgeReferenceAttributeValue(myDBObject, beAttr, beAttr.BackwardEdgeDefinition, myEdgeList, myUsingGraph, _DBContext);
if (notResolvedBEs != null)
{
myAttributes.Add(beAttr.Name, notResolvedBEs);
}
}
}
}
#endregion
#region Get all undefined attributes from DBO
if (mySelType == TypesOfSelect.Asterisk || mySelType == TypesOfSelect.Rhomb)
{
var undefAttrException = myDBObject.GetUndefinedAttributePayload(_DBContext.DBObjectManager);
if (undefAttrException.Failed())
throw new GraphDBException(undefAttrException.IErrors);
foreach (var undefAttr in undefAttrException.Value)
myAttributes.Add(undefAttr.Key, undefAttr.Value.GetReadoutValue());
}
#endregion
#region Add special attributes
if (mySelType == TypesOfSelect.Asterisk)
{
foreach (var specialAttr in GetSpecialAttributes(myType))
{
if (!myAttributes.ContainsKey(specialAttr.Name))
{
var result = (specialAttr as ASpecialTypeAttribute).ExtractValue(myDBObject, myType, _DBContext);
if (result.Failed())
{
throw new GraphDBException(result.IErrors);
}
myAttributes.Add(specialAttr.Name, result.Value.GetReadoutValue());
}
}
}
#endregion
}