コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }