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


C# GraphDBType.GetType方法代码示例

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


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

示例1: GenerateOutput

        /// <summary>
        /// Generate an output for an type with the attributes of the types and all parent types
        /// </summary>         
        /// <param name="myGraphDBType">The db type</param>
        /// <param name="myDBContext">The db context</param>
        /// <param name="myDepth">If depth == 0 only the type basic attributes will be returned</param>
        private Vertex GenerateOutput(DBContext myDBContext, GraphDBType myGraphDBType, Int32 myDepth = 0)
        {
            var retVal = new Vertex();

            if (myGraphDBType.ParentTypeUUID != null)

            retVal.AddAttribute("UUID",        myGraphDBType.UUID);
            retVal.AddAttribute("TYPE",        myGraphDBType.GetType().Name);
            retVal.AddAttribute("Name",        myGraphDBType.Name);
            retVal.AddAttribute("Comment",     myGraphDBType.Comment);

            if (myDepth > 0)
            {

                retVal.AddAttribute("Properties", new Edge(retVal, GeneratePropertiesOutput(myGraphDBType, myDBContext,
                    myGraphDBType.Attributes.Where(a => !(a.Value.EdgeType is IReferenceEdge)).Select(kv => kv.Value)))
                {
                    EdgeTypeName = "Property"
                });

                retVal.AddAttribute("Edges", new Edge(retVal, GenerateEdgesOutput(myGraphDBType, myDBContext, myGraphDBType.Attributes.Where(a => (a.Value.EdgeType is IReferenceEdge) && !a.Value.IsBackwardEdge).Select(kv => kv.Value)))
                {
                    EdgeTypeName = "Edge"
                });

                retVal.AddAttribute("BackwardEdges", new Edge(retVal, GenerateEdgesOutput(myGraphDBType, myDBContext, myGraphDBType.Attributes.Where(a => (a.Value.EdgeType is IReferenceEdge) && a.Value.IsBackwardEdge).Select(kv => kv.Value)))
                {
                    EdgeTypeName = "Edge"
                });

                retVal.AddAttribute("UniqueAttributes", new Edge(retVal, GeneratePropertiesOutput(myGraphDBType, myDBContext,
                    myGraphDBType.GetUniqueAttributes().Select(a => myGraphDBType.GetTypeAttributeByUUID(a))))
                {
                    EdgeTypeName = "Unique"
                });

                retVal.AddAttribute("MandatoryAttributes", new Edge(retVal, GeneratePropertiesOutput(myGraphDBType, myDBContext,
                    myGraphDBType.GetMandatoryAttributes().Select(a => myGraphDBType.GetTypeAttributeByUUID(a))))
                {
                    EdgeTypeName = "Mandatory"
                });

                retVal.AddAttribute("Indices", new Edge(retVal, GenerateIndicesOutput(myGraphDBType, myDBContext))
                {
                    EdgeTypeName = "Index"
                });

                if (myGraphDBType.ParentTypeUUID != null)
                {
                    var _ParentType = myDBContext.DBTypeManager.GetTypeByUUID(myGraphDBType.ParentTypeUUID);
                    retVal.AddAttribute("Extends", new Edge(retVal, GenerateOutput(myDBContext, _ParentType, myDepth - 1))
                    {
                        EdgeTypeName = "VertexType"
                    });
                }

            }

            return retVal;
        }
开发者ID:Vadi,项目名称:sones,代码行数:66,代码来源:DescribeTypeDefinition.cs


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