开发者

Convert query expression to dot notation

I want to convert these two query expressio开发者_开发知识库n into dot notation

Q1

var x = from tbl in Person.Get(2, cat.Count)
        group cat[i] by i/10;

Q2

foreach(var a in x)
    string.Split("-", a);

How to do?


This is untested, but please see if this produces correct results for you -

var catList = Person.Get(2, cat.Count);
catList.GroupBy(c => catList.Indexof(c)/10).Select(a => a.Split("-", a))


IEnumerable<string[]> result = (from tbl in Person.Get(2, cat.Count)
                        group cat[i] by i/10).Select(x=>x.Split('-'));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜