public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Comment = await _context.Comment .Include(c => c.Photo) .Include(c => c.Viewer).FirstOrDefaultAsync(m => m.Id == id); if (Comment == null) { return(NotFound()); } ViewData["PhotoId"] = new SelectList(_context.Set <Photo>(), "Id", "Caption"); ViewData["ViewerId"] = new SelectList(_context.Set <Viewer>(), "Id", "Email"); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Photo = await _context.Photo .Include(p => p.Uploader).FirstOrDefaultAsync(m => m.Id == id); if (Photo == null) { return(NotFound()); } ViewData["UploaderId"] = new SelectList(_context.Set <Uploader>(), "Id", "Email"); return(Page()); }
public IActionResult OnGet() { ViewData["PhotoId"] = new SelectList(_context.Set <Photo>(), "Id", "Caption"); ViewData["ViewerId"] = new SelectList(_context.Set <Viewer>(), "Id", "Name"); return(Page()); }
public IActionResult OnGet() { ViewData["UploaderId"] = new SelectList(_context.Set <Uploader>(), "Id", "Email"); return(Page()); }