public MDay GetReservations(string userId, DateTime Day) { var newDay = new MDay("Dinsdag"); newDay.Hours[2].Teacher = "*****@*****.**"; newDay.Hours[2].Course = "Student"; newDay.Hours[2].Reserved = true; return(newDay); }
// Remove the zero data private MDay RemoveZeroHoursDay(MDay currentDay) { var newDay = currentDay; var totalHours = currentDay.Hours.Count; for (var y = 0; y < totalHours; y++) { if (!currentDay.Hours[y].Reserved) { newDay.Hours.RemoveAt(y); y--; totalHours--; } } return(newDay); }