本文整理汇总了C#中DBObjectStream类的典型用法代码示例。如果您正苦于以下问题:C# DBObjectStream类的具体用法?C# DBObjectStream怎么用?C# DBObjectStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DBObjectStream类属于命名空间,在下文中一共展示了DBObjectStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BulkInsertDBO
/// <summary>
/// This will be invoked by the BulkInsert class.
/// </summary>
/// <param name="myTypeManager"></param>
/// <param name="myDBTypeStream"></param>
/// <param name="myDBObjectStream"></param>
/// <param name="myBulkInsert"></param>
internal BulkInsertDBO(DBContext myDBContext, GraphDBType myDBTypeStream, DBObjectStream myDBObjectStream, BulkInsert myBulkInsert)
{
_DBContext = myDBContext;
_DBTypeStream = myDBTypeStream;
_DBObjectStream = myDBObjectStream;
_BulkInsert = myBulkInsert;
}
示例2: Warning_EdgeToNonExistingNode
public Warning_EdgeToNonExistingNode(DBObjectStream myStartingNode, GraphDBType myTypeOfDBO, TypeAttribute myEdge, IEnumerable<IError> myErrors)
{
StartingNode = myStartingNode;
Errors = myErrors;
Edge = myEdge;
TypeOfDBO = myTypeOfDBO;
}
示例3: GetValueForAttribute
/// <summary>
/// <seealso cref=" AAttributeAssignOrUpdate"/>
/// </summary>
public override Exceptional<IObject> GetValueForAttribute(DBObjectStream myDBObject, DBContext myDBContext, GraphDBType myGraphDBType)
{
if (AttributeIDChain.IsUndefinedAttribute)
{
return new Exceptional<IObject>(GraphDBTypeMapper.GetBaseObjectFromCSharpType(Value));
}
#region Simple value
var dbType = AttributeIDChain.LastAttribute.GetDBType(myDBContext.DBTypeManager);
if (AttributeIDChain.LastAttribute is SpecialTypeAttribute_UUID)
{
dbType = myDBContext.DBTypeManager.GetTypeByName(GraphDBTypeMapper.GetBaseObjectFromCSharpType(Value).ObjectName);//DBString.Name);
}
if (GraphDBTypeMapper.IsAValidAttributeType(dbType, AttributeAssignType, myDBContext, Value))
{
return new Exceptional<IObject>(GraphDBTypeMapper.GetGraphObjectFromType(AttributeAssignType, Value)); ;
}
else
{
return new Exceptional<IObject>(new Error_InvalidAttributeValue(AttributeIDChain.LastAttribute.Name, Value));
}
#endregion
}
示例4: 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);
}
示例5: ExtractValue
public override Exceptional<IObject> ExtractValue(DBObjectStream dbObjectStream, GraphDBType graphDBType, DBContext dbContext)
{
EdgeTypeListOfBaseObjects parentRevisions = new EdgeTypeListOfBaseObjects();
foreach (var item in dbObjectStream.ParentRevisionIDs)
parentRevisions.Add(new DBString(item.ToString()));
return new Exceptional<IObject>(parentRevisions);
}
示例6: ExtractValue
public override Exceptional<IObject> ExtractValue(DBObjectStream dbObjectStream, GraphDBType graphDBType, DBContext dbContext)
{
EdgeTypeListOfBaseObjects streams = new EdgeTypeListOfBaseObjects();
foreach (var item in dbObjectStream.ObjectStreams)
streams.Add(new DBString(item.Key + " " + item.Value.ToString()));
return new Exceptional<IObject>(streams);
}
示例7: DBObjectMR
public DBObjectMR(DBObjectStream myDBObject, GraphDBType myDBTypeStream, DBContext myTypeManager)
{
_ObjectUUID = myDBObject.ObjectUUID;
_Attributes = new Dictionary<String, Object>();
foreach (var _Attribute in myDBTypeStream.Attributes)
{
_Attributes.Add(_Attribute.Value.Name, myDBObject.GetAttribute(_Attribute.Key));
}
}
示例8: ExtractValue
public override Exceptional<IObject> ExtractValue(DBObjectStream dbObjectStream, GraphDBType graphDBType, DBContext dbContext)
{
var myType = dbContext.DBTypeManager.GetTypeByUUID(dbObjectStream.TypeUUID);
if (myType != null)
{
return new Exceptional<IObject>(new DBString(myType.Name));
}
else
{
return new Exceptional<IObject>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
}
}
示例9: GetValueForAttribute
public override Exceptional<IObject> GetValueForAttribute(DBObjectStream aDBObject, DBContext dbContext, GraphDBType _Type)
{
#region ListOfDBObjects
if (AttributeIDChain.LastAttribute.GetDBType(dbContext.DBTypeManager).IsUserDefined)
{
//userdefined
//value = aSetNode.GetCorrespondigDBObjectUUIDs(aTaskNode.AttributeIDNodee, typeManager, dbObjectCache, mySessionToken);
if (CollectionDefinition.CollectionType == CollectionType.SetOfUUIDs)
{
var retVal = CollectionDefinition.TupleDefinition.GetAsUUIDEdge(dbContext, AttributeIDChain.LastAttribute);
if (!retVal.Success())
{
return new Exceptional<IObject>(retVal);
}
else
{
return new Exceptional<IObject>(retVal.Value);
}
}
else
{
var edge = (IEdgeType)(CollectionDefinition.TupleDefinition.GetCorrespondigDBObjectUUIDAsList(_Type, dbContext, AttributeIDChain.LastAttribute.EdgeType.GetNewInstance(), AttributeIDChain.LastAttribute.GetDBType(dbContext.DBTypeManager)).Value);
return new Exceptional<IObject>(edge);
}
}
else
{
//not userdefined
var edge = GetBasicList(dbContext);
if (edge.Failed())
{
return new Exceptional<IObject>(edge);
}
// If the collection was declared as a SETOF insert
if (CollectionDefinition.CollectionType == CollectionType.Set)
{
edge.Value.Distinction();
}
return new Exceptional<IObject>(edge.Value);
}
#endregion
}
示例10: GetValueForAttribute
public override Exceptional<IObject> GetValueForAttribute(DBObjectStream aDBObject, DBContext dbContext, GraphDBType _Type)
{
#region Expression
var validateResult = BinaryExpressionDefinition.Validate(dbContext, _Type);
if (validateResult.Failed())
{
return new Exceptional<IObject>(validateResult);
}
var value = BinaryExpressionDefinition.SimpleExecution(aDBObject, dbContext);
#endregion
return new Exceptional<IObject>(value);
}
示例11: ApplyUpdateListAttribute
public Exceptional<Tuple<String, TypeAttribute, IListOrSetEdgeType>> ApplyUpdateListAttribute(AAttributeAssignOrUpdateOrRemove myAttributeUpdateOrAssign, DBContext dbContext, DBObjectStream aDBObject, GraphDBType _Type)
{
if (myAttributeUpdateOrAssign is AttributeAssignOrUpdateList)
{
}
else if (myAttributeUpdateOrAssign is AttributeRemoveList)
{
}
else
{
return new Exceptional<Tuple<String, TypeAttribute, IListOrSetEdgeType>>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
}
return new Exceptional<Tuple<String, TypeAttribute, IListOrSetEdgeType>>(null as Tuple<String, TypeAttribute, IListOrSetEdgeType>);
}
示例12: GetValueForAttribute
public override Exceptional<IObject> GetValueForAttribute(DBObjectStream myDBObject, DBContext myDBContext, GraphDBType myGraphDBType)
{
if (AttributeIDChain.IsUndefinedAttribute)
{
return new Exceptional<IObject>(GraphDBTypeMapper.GetBaseObjectFromCSharpType(Value));
}
#region Simple value
if (GraphDBTypeMapper.IsAValidAttributeType(AttributeIDChain.LastAttribute.GetDBType(myDBContext.DBTypeManager), AttributeAssignType, myDBContext, Value))
{
return new Exceptional<IObject>(GraphDBTypeMapper.GetGraphObjectFromType(AttributeAssignType, Value)); ;
}
else
{
return new Exceptional<IObject>(new Error_InvalidAttributeValue(AttributeIDChain.LastAttribute.Name, Value));
}
#endregion
}
示例13: Update
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 undefined attributes
//TODO: change this to a more handling thing than KeyValuePair
var addExcept = myDBContext.DBObjectManager.AddUndefinedAttribute(UndefinedAttribute.AttributeName, UndefinedAttribute.AttributeValue, myDBObjectStream);
if (addExcept.Failed())
{
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(addExcept);
}
//sthChanged = true;
attrsForResult.Add(UndefinedAttribute.AttributeName, new Tuple<TypeAttribute, IObject>(new UndefinedTypeAttribute(UndefinedAttribute.AttributeName), UndefinedAttribute.AttributeValue));
#endregion
return new Exceptional<Dictionary<string, Tuple<TypeAttribute, IObject>>>(attrsForResult);
}
示例14: GetValueForAttribute
/// <summary>
/// <seealso cref=" AAttributeAssignOrUpdateOrRemove"/>
/// </summary>
public override Exceptional<IObject> GetValueForAttribute(DBObjectStream myDBObject, DBContext myDBContext, GraphDBType myDBType)
{
#region reference
var validationResult = AttributeIDChain.Validate(myDBContext, true, myDBType);
if (validationResult.Failed())
{
return new Exceptional<IObject>(validationResult);
}
if (AttributeIDChain.IsUndefinedAttribute)
{
return new Exceptional<IObject>(new Error_InvalidReferenceAssignmentOfUndefAttr());
}
// if we have a Userdefined Type, than all assignments will work on this type
if (!AttributeIDChain.LastAttribute.GetDBType(myDBContext.DBTypeManager).IsUserDefined)
{
//attributeType = _Type;
}
var value = AttributeIDChain.LastAttribute.EdgeType.GetNewInstance();
var dbos = SetRefDefinition.GetCorrespondigDBObjects(AttributeIDChain.LastAttribute.GetDBType(myDBContext.DBTypeManager), myDBContext, AttributeIDChain.LastAttribute.GetRelatedType(myDBContext.DBTypeManager));
foreach (var dbo in dbos)
{
if (dbo.Failed())
return new Exceptional<IObject>(dbo);
(value as ASingleReferenceEdgeType).Set(dbo.Value.ObjectUUID, AttributeIDChain.LastAttribute.DBTypeUUID, SetRefDefinition.Parameters);
}
#endregion
return new Exceptional<IObject>(value);
}
示例15: RemoveUndefinedAttribute
public Exceptional<Boolean> RemoveUndefinedAttribute(String myName, DBObjectStream myObject)
{
return myObject.RemoveUndefinedAttribute(myName, this);
}