Example #1
0
        public static List <Dictionary <string, object> > ToDictionaryList(GameImageList gameimageList)
        {
            var result = new List <Dictionary <string, object> >();

            try
            {
                if (gameimageList?.List?.Count > 0)
                {
                    result = (from gameimage in gameimageList.List where gameimage != null select GameImage.ToDictionary(gameimage) into dictionary where dictionary?.Count > 0 select dictionary).ToList();
                }
            }

            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(result);
        }
Example #2
0
        public static GameImageList FromDictionaryList(List <Dictionary <string, object> > dictionaryList)
        {
            var result = new GameImageList();

            try
            {
                if (dictionaryList?.Count > 0)
                {
                    foreach (var dataDictionary in dictionaryList.Where(dataDictionary => dataDictionary?.Count > 0))
                    {
                        result.List.Add(GameImage.FromDictionary(dataDictionary));
                    }
                }
            }

            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(result);
        }