LINQ Lambda-Expression Diff

It's probably very simple, I'm just on the fence today.

The Lambda version works as expected the Expression version does not. Do you see where the difference is?

Works:
var groupedOccurences = occurences
                    .SelectMany(static occurence => occurence.MailAddress.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(addr => new
                    {
                        MailAddress = addr.Trim(),
                        occurence.DatabasePath,
                        occurence.MaskName
                    }))
                    .GroupBy(static occurence => occurence);


Does not work (different results):
var groupedOccurences = from occurence in occurences
                        from address in occurence.MailAddress.Split(',', StringSplitOptions.RemoveEmptyEntries)
                        group new {
                            MailAddress = address.Trim(),
                            occurence.DatabasePath,
                            occurence.MaskName
                        } by occurence into grp
                        select grp;
Was this page helpful?