I need to display the next Meeting Date from a table of meeting dates. Once a date passes as current, the next date is supposed to show up. I've searched for similar examples but no luck:
05/21/2019
07/11/2019
08/08/2019
09/12/2019
10/10/2019
11/14/2019
12/12/2019
Here the Linq query I have that fails. It doesn't return anything for example after the 10/10/2019 date because 11/14/2019 is actually more than 1 month.
var LinqResult = (from c in _context.MeetingSchedule
where c.MeetingDate.Date >= DateTime.Now.Date && c.MeetingDate.Date <= DateTime.Now.Date.AddMonths(1)
select new { c.Location, c.MeetingDate, c.MeetingTime }).ToArray();
if (LinqResult.Any())
{
//SEND NEXT MEETING DATE BACK VIA VIEWSTATE
}
Also, I am pretty sure something odd is going to happen on the last month of the year after the meeting happens (December). I am trying to show the current next meeting, and have it change to the next meeting after that once the current one is over. Adding a month to 12 will create a month number 13 which is non-existent.