Assuming you can group all the null Programs together and Id will be non-negative, how about something like this:
GroupBy(x => x.Programa == null ? -1 : x.Programa.Id)
Assuming you can group all the null Programs together and Id will be non-negative, how about something like this:
GroupBy(x => x.Programa == null ? -1 : x.Programa.Id)