public async Task <IActionResult> UpdateVideoGallery(int Id = 0)
        {
            if (Id != 0)
            {
                var videoGallery = await _IVideoGalleryRepository.GetByIdAsync(Id);

                if (videoGallery != null)
                {
                    return(View(new VideoGalleryViewModel()
                    {
                        Id = videoGallery.Id,
                        IsActive = videoGallery.IsActive,
                        Order = videoGallery.Order,
                        ImageURL = videoGallery.ImageURL,
                        VideoEmbed = videoGallery.VideoEmbed,
                        EmbedKey = videoGallery.EmbedKey
                    }));
                }
                else
                {
                    TempData["MessageError"] = string.Format("{0}", "Video Gallery empty, do not exist!");
                }
            }

            return(View(new VideoGalleryViewModel()
            {
                Id = 0
            }));
        }
        public async Task <int> Update(VideoGalleryViewModel model)
        {
            try
            {
                var vgallery = await _IVideoGalleryRepository.GetByIdAsync(model.Id);

                if (vgallery != null)
                {
                    vgallery.IsActive     = model.IsActive;
                    vgallery.DateModified = DateTime.Now;
                    vgallery.UserModified = model.UserModified;
                    vgallery.EmbedKey     = model.EmbedKey;
                    vgallery.ImageURL     = model.ImageURL;
                    vgallery.VideoEmbed   = model.VideoEmbed;

                    await _IVideoGalleryRepository.UpdateAsync(vgallery);

                    return(vgallery.Id);
                }
            }
            catch
            {
                return(0);
            }

            return(0);
        }