I would like to translate the following SQL into LINQ:
SELECT (Select count(BidID)) as TotalBidNum, (Select sum(Amount)) as TotalBidVal FROM Bids
You can write this query using GroupBy. The Lambda expression is as follows:
GroupBy
var itemsBid = db.Bids .GroupBy( i => 1) .Select( g => new { TotalBidVal = g.Sum(item => item.Amount), TotalBidNum = g.Count(item => item.BidId) });