Matt Kraven
Matt Kraven

Reputation: 141

Converting into Lambda Expression

Can anyone help me convert this to a Lambda form

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

Upvotes: 1

Views: 114

Answers (2)

TheRealTy
TheRealTy

Reputation: 2429

Is that what you after?

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

Upvotes: 1

dtb
dtb

Reputation: 217233

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

Upvotes: 5

Related Questions