转换为Lambda表达式

时间:2011-06-22 03:17:06

标签: c# linq

任何人都可以帮我将其转换为Lambda表单

double abc = (from x in y
select (new Employee(x)).Name).SomeMethod();
abc = Math.Double(abc/1000, 2.0);

2 个答案:

答案 0 :(得分:5)

double abc = y.Select(x => new Employee(x).Name)
              .SomeMethod();

答案 1 :(得分:1)

那是你的追求吗?

var abc = y.Select(x =>  new Employee(x).Name).SomeMethod();
abc = Math.Double(abc/1000, 2.0);