public static List <Game> FilterOutUnsupportedPlatforms(List <Game> input)
        {
            var platforms = DbAccess.GetPlatforms().Select(x => x.Id).ToList();

            var retval = new List <Game>();

            foreach (var i in input)
            {
                // Some games don't have platforms
                if (i.Platforms == null || !i.Platforms.Any())
                {
                    continue;
                }

                foreach (var j in i.Platforms)
                {
                    if (!platforms.Contains(j.Id))
                    {
                        continue;
                    }

                    retval.Add(i);
                    break;
                }
            }

            return(retval);
        }
        private static List <DbGamePlatform> CreateDbGamePlatformsListWithoutNavigation(Game gbGame)
        {
            var platforms = DbAccess.GetPlatforms(gbGame.Platforms);

            return(platforms?.Select(p => new DbGamePlatform {
                GameId = gbGame.Id, PlatformId = p.Id
            }).ToList());
        }
 public static List <DbPlatform> GetPlatforms()
 {
     return(DbAccess.GetPlatforms());
 }