using System.Collections.Generic;
public static void Main()
new() { Name = "Bram", Bsn = "12345678" }
.GroupBy(x => !string.IsNullOrWhiteSpace(x.Bsn));
if (groupedByValid.Any(g => !g.Key))
Console.WriteLine($"invalid: {string.Join(',', groupedByValid.Where(g => !g.Key).SelectMany(g => g.Select(x => x.Name)))}");
Console.WriteLine($"valid: {string.Join(',', groupedByValid.Where(g => g.Key).SelectMany(g => g.Select(x => x.Name)))}");
public string Bsn { get; set; }
public string Name { get; set; }