コード例 #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            FileKeywordDTO = await _context.FileKeywordDTO
                             .Include(f => f.File)
                             .Include(f => f.Keyword).FirstOrDefaultAsync(m => m.FIleKeywordId == id);

            if (FileKeywordDTO == null)
            {
                return(NotFound());
            }
            ViewData["FileId"]    = new SelectList(_context.FileDTO, "FileId", "FileId");
            ViewData["KeywordId"] = new SelectList(_context.Set <KeywordDTO>(), "Id", "Id");
            return(Page());
        }
コード例 #2
0
 public IActionResult OnGet()
 {
     ViewData["FileId"]    = new SelectList(_context.FileDTO, "FileId", "FileId");
     ViewData["KeywordId"] = new SelectList(_context.Set <KeywordDTO>(), "Id", "Id");
     return(Page());
 }