Ejemplo n.º 1
0
        public void UpdateMovieCast(MovieCast movieCast)
        {
            _context.MovieCast.Remove(_context.MovieCast.FirstOrDefault(m => (m.MovieId == movieCast.MovieId && m.PersonId == movieCast.PersonId && movieCast.Role == m.Role)));
            _context.MovieCast.Add(movieCast);

            /* var cast = _context.MovieCast
             *   .Where(e => e.PersonId == movieCast.PersonId)
             *   .First(e => e.MovieId == movieCast.MovieId)
             *
             * cast.Role = movieCast.Role; */
        }
Ejemplo n.º 2
0
 public bool RemoveMovieCast(MovieCast movieCast)
 {
     _context.MovieCast.Remove(movieCast);
     _context.SaveChanges();
     return(true);
 }
Ejemplo n.º 3
0
 public bool AddMovieCast(MovieCast movieCast)
 {
     _context.MovieCast.Add(movieCast);
     _context.SaveChanges();
     return(true);
 }
Ejemplo n.º 4
0
 public void AddMovieCast(MovieCast movieCast)
 {
     _context.MovieCast.Add(movieCast);
 }
Ejemplo n.º 5
0
 public void DeleteMovieCast(MovieCast movieCast)
 {
     //_context.MovieCast.Remove(movieCast);
     _context.MovieCast.Remove(_context.MovieCast.FirstOrDefault(m => (m.MovieId == movieCast.MovieId && m.PersonId == movieCast.PersonId)));
 }