Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要Select在 LINQ 中为包含字段 A、B、C 的表形成查询。我需要获取值A和A - B.
Select
A
A - B
试试这个:
from t in yourTable select t.A, t.A - t.B
尝试Select(r = new { r.A, Difference = r.A - r.B })
Select(r = new { r.A, Difference = r.A - r.B })