public IActionResult OnGet()
        {
            ViewData["DoctorID"] = new SelectList(_context.Set <Doctor>(), "ID", "Code");

            var children = new Children();

            children.Appointments = new List <Appointment>();
            PopulateAssignedAvailabilityData(_context, children);

            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Children = await _context.Children
                       .Include(b => b.Doctor)
                       .Include(b => b.Appointments).ThenInclude(b => b.AvailableTimeDate)
                       .AsNoTracking()
                       .FirstOrDefaultAsync(m => m.ID == id);

            if (Children == null)
            {
                return(NotFound());
            }

            PopulateAssignedAvailabilityData(_context, Children);
            ViewData["DoctorID"] = new SelectList(_context.Set <Doctor>(), "ID", "Code");
            return(Page());
        }