Exemplo n.º 1
0
        public async Task UpdateFilm(Guid id, StreamEditModelFilmflixDisplay formData)
        {
            var model = _context.ClamUserFilms.Find(formData.FilmId);

            _context.Entry(model).Entity.FilmTitle        = formData.FilmTitle;
            _context.Entry(model).Entity.UrlEmbeddedVideo = FilePathUrlHelper.YoutubePathFilter(formData.UrlEmbeddedVideo);
            _context.Entry(model).Entity.Status           = bool.Parse(formData.Status);
            _context.Entry(model).Entity.Year             = formData.Year;
            _context.Entry(model).Entity.LastModified     = DateTime.Now;
            _context.Entry(model).State = EntityState.Modified;
            _context.Update(model);
            await _context.SaveChangesAsync();
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetEditFilm(Guid id, StreamEditModelFilmflixDisplay formData)
        {
            await _unitOfWork.FilmControl.UpdateFilm(id, formData);

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