Ejemplo n.º 1
0
        private List <object> GetExportList(IList <DMCustomer> customertList, Dictionary <string, string> header)
        {
            var     exportList = new List <object>();
            dynamic objectList = new List <dynamic>();

            foreach (var contract in customertList)
            {
                var prop           = new ExpandoObject() as IDictionary <string, Object>;
                var contractObject = MapperHelper.CreateObjectWithValueFromObject(contract, header);

                IDictionary <string, string> dictionary = new Dictionary <string, string>();
                objectList.Add(new ExpandoObject());
                foreach (var item in contractObject)
                {
                    prop.TryAdd <string, Object>(item.Key, item.Value);
                }
                exportList.Add(prop);
            }
            return(exportList);
        }