public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var user = await _context.GetUserAsync(User); if (user == null) { return(NotFound()); } var video = _context.Videos.FirstOrDefault(v => v.Id == id); if (video == null) { return(NotFound()); } VideoModel = new VideoModel() { Id = video.Id, VideoId = video.VideoId, VideoType = video.VideoType }; return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var result = _context.Videos.FirstOrDefault(v => v.Id == id.Value); VideoModel = new VideoModel() { Id = result.Id, VideoId = result.VideoId, VideoType = result.VideoType }; return(Page()); }