2

有没有办法自动从 linq 方法语法转换为查询语法?

EG:我想自动转换它:

var aux = Directory.EnumerateDirectories(@"c:\")
                .Where(directory => directory.Contains("xxx"))
                .ToList();

对它:

var aux = (from directory in Directory.EnumerateDirectories(@"c:\")
                  where directory.Contains("xxx")
                  select directory).ToList();
4

0 回答 0