コード例 #1
0
ファイル: GraphTypeFactory.cs プロジェクト: jaygumji/EnigmaDb
        public IGraphType GetOrCreate(Type type)
        {
            var serType = _provider.GetOrCreate(type);

            var graphProperties = new List<IGraphProperty>();
            var properties = serType.Properties;
            foreach (var property in properties) {
                var graphProperty = Create(property);
                graphProperties.Add(graphProperty);
            }

            var graphType = new ComplexGraphType(graphProperties);
            _graphTypes.Add(type, graphType);
            return graphType;
        }
コード例 #2
0
        public IGraphType GetOrCreate(Type type)
        {
            var serType          = _provider.GetOrCreate(type);
            var visitArgsFactory = new VisitArgsFactory(_provider, type);

            var graphProperties = new List <IGraphProperty>();
            var properties      = serType.Properties;

            foreach (var property in properties)
            {
                var args          = visitArgsFactory.Construct(property.Ref.Name);
                var graphProperty = Create(property, args);
                graphProperties.Add(graphProperty);
            }

            var graphType = new ComplexGraphType(graphProperties);

            _graphTypes.Add(type, graphType);
            return(graphType);
        }