public async Task <IActionResult> Edit(int id, [Bind("VideohuongdanId,VideohuongdanTieude,VideohuongdanHinhanh,VideohuongdanLinkvideo")] TbVideoHuongDan tbVideoHuongDan)
        {
            if (id != tbVideoHuongDan.VideohuongdanId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tbVideoHuongDan);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TbVideoHuongDanExists(tbVideoHuongDan.VideohuongdanId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbVideoHuongDan));
        }
        public async Task <IActionResult> Create(TbVideoHuongDan tbVideoHuongDan, IFormFile VideohuongdanHinhanh)
        {
            if (ModelState.IsValid)
            {
                if (VideohuongdanHinhanh.Length > 0)
                {
                    var    fileName  = ContentDispositionHeaderValue.Parse(VideohuongdanHinhanh.ContentDisposition).FileName.Trim('"');
                    string ImageName = Guid.NewGuid().ToString() + Path.GetExtension(VideohuongdanHinhanh.FileName);
                    var    path      = Path.Combine(Directory.GetCurrentDirectory(), $"wwwroot\\Uploadimages\\{ImageName}");
                    var    pathView  = $"\\Uploadimages\\{ImageName}";
                    using (var stream = new FileStream(path, FileMode.Create))
                    {
                        await VideohuongdanHinhanh.CopyToAsync(stream);
                    }
                    tbVideoHuongDan.VideohuongdanHinhanh = pathView;
                    //tbSlide.CamnangNgaytao = DateTime.Now;
                }
                _context.Add(tbVideoHuongDan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbVideoHuongDan));
        }