Another way:
Select(g => { var obj = new AssembledPartsDTO { References= ... }; if (obj.References.Count == 0) { obj.References.Add("??"); } return obj; })
You may need this for more complex logic where the ternary operator (?) Is not applied.
source share