public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var archiveVideoEntity = await _context.ArchiveVideos.AsNoTracking() .Include(v => v.Questions) .FirstOrDefaultAsync(v => v.Id == id); if (archiveVideoEntity == null) { return(NotFound()); } ArchiveVideoModel = new ArchiveVideoEditDTO { Id = archiveVideoEntity.Id, DateCreated = archiveVideoEntity.DateCreated, ShowNotes = archiveVideoEntity.ShowNotes, Title = archiveVideoEntity.Title, VideoUrl = archiveVideoEntity.VideoUrl }; Questions = archiveVideoEntity.Questions; return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var archiveVideoEntity = _repository.GetById <ArchiveVideo>(id.Value); if (archiveVideoEntity == null) { return(NotFound()); } ArchiveVideoModel = new ArchiveVideoEditDTO { Id = archiveVideoEntity.Id, DateCreated = archiveVideoEntity.DateCreated, ShowNotes = archiveVideoEntity.ShowNotes, Title = archiveVideoEntity.Title, VideoUrl = archiveVideoEntity.VideoUrl }; return(Page()); }