コード例 #1
0
ファイル: Delete.cshtml.cs プロジェクト: SJM18/LtiAdvantage
        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());
        }
コード例 #2
0
        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());
        }