I want to group this group of data from
Column1; Column2
QA7878736A; A6378787AQ
QA7878751B; B1578787AQ
QA7878834C; C4388787AQ
QB7878729D; D9278787AQ
QB7878726D; D6278787BQ
to this format
QA-A = 1
QA-B = 1
QA-C = 1
QB-D = 2
and then store it in the GroupByModel list. This is the LINQ I currently have.
List<GroupByModel> counts = ColumnsSwapped
.GroupBy(o => o.Column1.Substring(0, 2), o => o.Column2.Substring(0, 1))
.Select(g => new GroupByModel { SuffixGroup = g.Key, Key = g.Count() }).ToList();
But with the above LINQ, I'm only getting grouped by the Column1 and not showing the Column 2.