1

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);

2 Answers 2

5
double abc = y.Select(x => new Employee(x).Name)
              .SomeMethod();
Sign up to request clarification or add additional context in comments.

Comments

1

Is that what you after?

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

3 Comments

Looks like the second call to abc was removed from the question. Now your answer looks confusing.
I didn't remove it. 'dtb' did. Thanks for the answer
@Matt Kraven: Indeed. Because you were asking about the LINQ expression, not the surrounding code. BTW, there is no Math.Double method in the Math Class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.