public virtual void AddItem(addMovie movie, int quantity) { MovieLine line = Lines.Where(m => m.addMovie.MovieID == movie.MovieID) .FirstOrDefault(); if (line == null) { Lines.Add(new MovieLine { addMovie = movie, Quantity = quantity, }); } else { line.Quantity += quantity; } }
public virtual void RemoveLine(addMovie addM) => Lines.RemoveAll(x => x.addMovie.MovieID == addM.MovieID);