Beispiel #1
0
        /// <summary>
        /// Convert Smartobject collection to dictionary.
        /// </summary>
        /// <param name="smItem">The SmartObjectCollection.</param>
        /// <returns></returns>
        private Dictionary <string, string> ConvertToModel(SmartObjectCollection smItem)
        {
            var result = new Dictionary <string, string>();

            foreach (SmartObject item in smItem)
            {
                foreach (SmartProperty property in item.Properties)
                {
                    result.Add(property.Name, property.Value);
                }
            }
            return(result);
        }
        /// <summary>
        /// Map all properties in smartobject to list dictionary.
        /// </summary>
        /// <param name="smItem">The SmartObject Collection.</param>
        /// <returns></returns>
        private List <Dictionary <string, object> > ConvertToModel(SmartObjectCollection smItem)
        {
            List <Dictionary <string, object> > result = new List <Dictionary <string, object> >();

            foreach (SmartObject item in smItem)
            {
                Dictionary <string, object> temp = new Dictionary <string, object>();
                foreach (SmartProperty propertie in item.Properties)
                {
                    temp.Add(propertie.Name, propertie.Value);
                }
                result.Add(temp);
            }
            return(result);
        }