using System.Collections.Generic;
public int Id { get; set; }
public string Country { get; set; }
public string Name { get; set; }
public string Status { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public string Status { get; set; }
public string Country { get; set; }
public List<Details> Details { get; set; }
public static void Main()
var countries = new List<Countries>
new() { Id = 1, Country = "Uruguay", Name = "Foo", Status = "Completed" },
new() { Id = 2, Country = "Uruguay", Name = "Foo", Status = "Completed" },
new() { Id = 3, Country = "Germany", Name = "Foo", Status = "Completed" },
List<CountryList> countryList = countries
( country, matches ) => new CountryList()
Details = matches.Select(match => new Details
foreach (var countryGroup in countryList)
Console.WriteLine($"Country: {countryGroup.Country}");
Console.WriteLine($"Details:");
foreach (var detail in countryGroup.Details)
Console.WriteLine($"\tId: {detail.Id}");
Console.WriteLine($"\tName: {detail.Name}");
Console.WriteLine($"\tStatus: {detail.Status}");
Console.WriteLine("\t-----");