예제 #1
0
        public IReadOnlyDictionary <string, ToscaProperty> CombineAndMerge <T>(IToscaEntityWithProperties <T> toscaEntity)
            where T : IToscaEntityWithProperties <T>
        {
            var combineProperties = toscaPropertyCombiner.CombineProperties(toscaEntity);

            return(MergeProperties(combineProperties));
        }
예제 #2
0
        public Dictionary <string, List <ToscaProperty> > CombineProperties <T>(
            IToscaEntityWithProperties <T> toscaEntity)
            where T : IToscaEntityWithProperties <T>
        {
            var combinedProperties = new Dictionary <string, List <ToscaProperty> >();

            for (var currNodeType = toscaEntity; currNodeType != null; currNodeType = currNodeType.GetDerivedFromEntity())
            {
                foreach (var propertyKeyValue in currNodeType.Properties)
                {
                    if (!combinedProperties.ContainsKey(propertyKeyValue.Key))
                    {
                        combinedProperties.Add(propertyKeyValue.Key, new List <ToscaProperty>());
                    }
                    combinedProperties[propertyKeyValue.Key].Add(propertyKeyValue.Value);
                }
            }
            return(combinedProperties);
        }