storestid | regionid | startvalue | startfee | addvalue | addfee
9 320200 1 6 3 3
9 320300 1 6 4 4
9 320400 1 6 3 3
9 320900 1 6 5 5
storestid | regionid | startvalue | startfee | addvalue | addfee
9 320400,320200 1 6 3 3
9 320300 1 6 4 4
9 320900 1 6 5 5
自己已解决贴出代码方便后面的人!
var deptList = (from p in info.Storeshipfeeinfolist
group p by new
{
p .startfee,
p .startvalue,
p .addfee,
p .addvalue
}
into g
let ids = g.Select(b => b.regionid.ToString()).ToArray()
select new {
regionids = String.Join(",", ids),
startfee = g.Key.startfee,
startvalue = g.Key.startvalue,
addfee = g.Key.addfee,
addvalue = g.Key.addvalue,
}).ToList();
推荐直接写sql吧
– 会长 4年前