示例#1
0
        public async Task <ActionResult <Video> > PostVideo(VideoBuilder URL)
        {
            string videoID  = YoutubeHelper.GetVideoLink(URL.URL);
            Video  newVideo = YoutubeHelper.getVideoInfo(videoID);

            _context.Video.Add(newVideo);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetVideo", new { id = newVideo.VideoId }, newVideo));
        }