Reputation: 1453
I need to form a Select query in LINQ for a table with fields A, B, C. I need to get the values A and A - B.
Select
A
A - B
Upvotes: 0
Views: 1758
Reputation: 185
Try Select(r = new { r.A, Difference = r.A - r.B })
Select(r = new { r.A, Difference = r.A - r.B })
Upvotes: 1
Reputation: 9494
Try this:
from t in yourTable select t.A, t.A - t.B
Upvotes: 2