New answers tagged

4 votes

"Select followed by First" versus "First followed by Select" when summing the data for a student

Option 1 students .Select(x => new { Id = x.Id, Sum = x.Data.SelectMany(n => n).Sum() }) .FirstOrDefault(s => s.Id == 1) .Sum; ...
user avatar
  • 5,760
4 votes
Accepted

Calculate the number of people occupied at each time interval

Generally, at the edge of your program you shouldn't be entering datetimes as timestamp numeric literals, but as human-legible datetimes. On the inside of your program, you also shouldn't be ...
user avatar
  • 49.7k

Top 50 recent answers are included