Ejemplo n.º 1
0
        public IStructure <TSchema> Build()
        {
            var builder = new StructureBuilder <TSchema>(_schema);

            var graph = new DependencyGraph <Type>();

            foreach (var specification in _specifications)
            {
                foreach (var layoutType in specification.Value.GetReferencedLayoutTypes())
                {
                    graph.Add(specification.Key, layoutType);
                }
            }

            var orderedSpecifications = graph.GetItemsInDependencyOrder()
                                        .Concat(_specifications.Keys)
                                        .Distinct()
                                        .Select(type => _specifications[type]);

            foreach (var specification in orderedSpecifications)
            {
                specification.Apply(builder);
            }

            return(builder.Build());
        }
Ejemplo n.º 2
0
        internal static DurationValue Build <T1>(IDictionary <T1> input) where T1 : Org.Neo4j.Values.AnyValue
        {
            StructureBuilder <AnyValue, DurationValue> builder = builder();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (java.util.Map.Entry<String,? extends org.neo4j.values.AnyValue> entry : input.entrySet())
            foreach (KeyValuePair <string, ? extends AnyValue> entry in input.SetOfKeyValuePairs())
            {
                builder.Add(entry.Key, entry.Value);
            }
            return(builder.Build());
        }