public IActionResult Edit(Guid appointmentId, DateTime startDate) { Schedule schedule = _repository.GetScheduleForDate(1, startDate); AppointmentViewModel appointmentVM = new AppointmentViewModelFactory().FromAppointmentViewModel(schedule.Appointments.Single(a => a.Id == appointmentId)); return(View(appointmentVM)); }
public IActionResult Index() { AppointmentViewModelFactory factory = new AppointmentViewModelFactory(); Schedule schedule = _repository.GetScheduleForDate(1, new DateTime(2018, 6, 16)); IEnumerable <AppointmentViewModel> appointmentVMs = schedule.Appointments.Select(a => factory.FromAppointmentViewModel(a)).OrderBy(a => a.StartTime); return(View(appointmentVMs)); }