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


C# GraphDBType.GetAllAttributes方法代码示例

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


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

示例1: AddTypeAndAttributesRecursivly

        private void AddTypeAndAttributesRecursivly(DBContext myDBContext, GraphDBType type, ref HashSet<GraphDBType> types)
        {
            if (!type.IsUserDefined) return;

            foreach (var ptype in myDBContext.DBTypeManager.GetAllParentTypes(type, true, false))
            {
                if (!types.Contains(ptype))
                {
                    types.Add(ptype);
                    foreach (var attr in type.GetAllAttributes(ta => !ta.IsBackwardEdge, myDBContext, false))
                    {
                        AddTypeAndAttributesRecursivly(myDBContext, attr.GetDBType(myDBContext.DBTypeManager), ref types);
                    }
                }

                //types.UnionWith(myDBContext.DBTypeManager.GetAllParentTypes(type, true, false));

            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:19,代码来源:AGraphDBExport.cs

示例2: GetSpecialAttributes

        private IEnumerable<TypeAttribute> GetSpecialAttributes(GraphDBType type)
        {

            if (!_SpecialAttributesByType.ContainsKey(type))
            {
                _SpecialAttributesByType.Add(type, type.GetAllAttributes(t => t is ASpecialTypeAttribute, _DBContext).ToList());
            }

            return _SpecialAttributesByType[type];

        }
开发者ID:ipbi,项目名称:sones,代码行数:11,代码来源:SelectResultManager.cs

示例3: Execute

        public override Exceptional Execute(DBContext dbContext, GraphDBType graphDBType)
        {
            var listOfTypeAttributes = new Dictionary<TypeAttribute, GraphDBType>();
            var retExcept = new Exceptional();
            var existingTypeAttributes = graphDBType.GetAllAttributes(dbContext);

            foreach (var attr in _ListOfAttributes)
            {
                var createExcept = attr.CreateTypeAttribute(dbContext);

                if (!createExcept.Success())
                {
                    retExcept.PushIExceptional(createExcept);
                }

                if (existingTypeAttributes.Exists(item => item.Name == createExcept.Value.Name))
                {
                    retExcept.PushIExceptional(new Exceptional(new Error_AttributeAlreadyExists(createExcept.Value.Name)));
                }

                var attrType = dbContext.DBTypeManager.GetTypeByName(attr.AttributeType.Name);

                if (attrType == null)
                {
                    retExcept.PushIExceptional(new Exceptional(new Error_TypeDoesNotExist(attr.AttributeType.Name)));
                    return retExcept;
                }

                if (attrType.IsUserDefined)
                {
                    retExcept.PushIExceptional(new Exceptional(new Error_InvalidReferenceAssignmentOfUndefAttr()));
                    return retExcept;
                }

                createExcept.Value.DBTypeUUID = attrType.UUID;
                createExcept.Value.RelatedGraphDBTypeUUID = graphDBType.UUID;

                graphDBType.AddAttribute(createExcept.Value, dbContext.DBTypeManager, true);

                var flushExcept = dbContext.DBTypeManager.FlushType(graphDBType);

                if (!flushExcept.Success())
                {
                    retExcept.PushIExceptional(flushExcept);
                }

                listOfTypeAttributes.Add(createExcept.Value, attrType);
            }

            var dbobjects = dbContext.DBObjectCache.SelectDBObjectsForLevelKey(new LevelKey(graphDBType, dbContext.DBTypeManager), dbContext);

            foreach (var item in dbobjects)
            {
                if (!item.Success())
                {
                    retExcept.PushIExceptional(item);
                }
                else
                {
                    var undefAttrExcept = item.Value.GetUndefinedAttributePayload(dbContext.DBObjectManager);

                    if (!undefAttrExcept.Success())
                    {
                        retExcept.PushIExceptional(undefAttrExcept);
                    }

                    foreach (var attr in listOfTypeAttributes)
                    {
                        IObject value;

                        if (undefAttrExcept.Value.TryGetValue(attr.Key.Name, out value))
                        {
                            var typeOfOperator = GraphDBTypeMapper.ConvertGraph2CSharp(attr.Value.Name);

                            if (GraphDBTypeMapper.IsAValidAttributeType(attr.Value, typeOfOperator, dbContext, value))
                            {
                                item.Value.AddAttribute(attr.Key.UUID, value);

                                var removeExcept = item.Value.RemoveUndefinedAttribute(attr.Key.Name, dbContext.DBObjectManager);

                                if (!removeExcept.Success())
                                {
                                    retExcept.PushIExceptional(removeExcept);
                                }

                                var flushExcept = dbContext.DBObjectManager.FlushDBObject(item.Value);

                                if (!flushExcept.Success())
                                {
                                    retExcept.PushIExceptional(flushExcept);
                                }
                            }
                            else
                            {
                                retExcept.PushIExceptional(new Exceptional(new Error_InvalidUndefAttrType(attr.Key.Name, attr.Value.Name)));
                            }
                        }
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:TheByte,项目名称:sones,代码行数:101,代码来源:AlterType_DefineAttributes.cs

示例4: GetBackwardEdgeAttributes

        private IEnumerable<TypeAttribute> GetBackwardEdgeAttributes(GraphDBType type)
        {

            if (!_BackwardEdgeAttributesByType.ContainsKey(type))
            {
                _BackwardEdgeAttributesByType.Add(type, type.GetAllAttributes(t => t.IsBackwardEdge, _DBContext).ToList());
            }

            return _BackwardEdgeAttributesByType[type];

        }
开发者ID:ipbi,项目名称:sones,代码行数:11,代码来源:SelectResultManager.cs


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