I have written below code but it throws an error
var conflictcomments = (item.Key == Constant.SB023)
? item.GroupBy(m => new { m.UserGroup, m.IGGConflict })
: item.GroupBy(m => new { m.CompanyCodeConflict, m.IGGConflict });
Error message:
Type of conditional expression cannot be determined because there is no implicit conversion between 'System.Collections.Generic.IEnumerable<System.Linq.IGrouping<<anonymous type: string UserGroup, string IGGConflict>, Entities.MitigatingControlComments>>' and 'System.Collections.Generic.IEnumerable<System.Linq.IGrouping<<anonymous type: string CompanyCodeConflict, string IGGConflict>, Entities.MitigatingControlComments>>'