Esempio n. 1
0
        public static List <Dictionary <string, object> > ToDictionaryList(PlatformList platformlist)
        {
            var result = new List <Dictionary <string, object> >();

            try
            {
                result = (from platform in platformlist.List where platform != null select Platform.ToDictionary(platform) into dictionary where dictionary?.Count > 0 select dictionary).ToList();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
            return(result);
        }
Esempio n. 2
0
        public static PlatformList FromDictionaryList(List <Dictionary <string, object> > dictionaryList)
        {
            var result = new PlatformList();

            try
            {
                if (dictionaryList?.Count > 0)
                {
                    foreach (var dataDictionary in dictionaryList.Where(dataDictionary => dataDictionary.Count > 0))
                    {
                        result.List.Add(Platform.FromDictionary(dataDictionary));
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
            return(result);
        }