public PlatformInfo GetPlatformByTag(string fullTagName) { PlatformInfo result = AllRepos .SelectMany(repo => repo.AllImages) .SelectMany(image => image.AllPlatforms) .FirstOrDefault(platform => platform.Tags.Any(tag => tag.FullyQualifiedName == fullTagName)); if (result == null) { throw new InvalidOperationException($"Unable to find platform for the tag '{fullTagName}'"); } return(result); }
public ImageInfo GetImageByPlatform(PlatformInfo platform) => GetAllImages() .FirstOrDefault(image => image.AllPlatforms.Contains(platform));