예제 #1
0
        /// <summary>
        /// Converts a list of string maps to a list of instances.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="map">The map.</param>
        /// <returns></returns>
        public static IList <T> FromListStringMap <T>(IList <Dictionary <string, string> > map)
        {
            if (map == null)
            {
                return(null);
            }
            IObjectProxy proxy  = Get <T>();
            IList <T>    result = (IList <T>)proxy.CreateList();

            foreach (Dictionary <string, string> row in map)
            {
                T item = (T)proxy.CreateObject();
                proxy.ReadFromStringMap(item, row);
                result.Add(item);
            }
            return(result);
        }