Exemplo n.º 1
0
        public static List <Dictionary <string, object> > ToDictionaryList(GameRatingList gameGenreList)
        {
            var result = new List <Dictionary <string, object> >();

            try
            {
                if (gameGenreList?.List?.Count > 0)
                {
                    result = (from gamerating in gameGenreList.List where gamerating != null select GameRating.ToDictionary(gamerating) into dictionary where dictionary?.Count > 0 select dictionary).ToList();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
            return(result);
        }
Exemplo n.º 2
0
        public static GameRatingList FromDictionaryList(List <Dictionary <string, object> > dictionaryList)
        {
            var result = new GameRatingList();

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