Example #1
0
        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;
            }
        }
Example #2
0
 public virtual void RemoveLine(addMovie addM) =>
 Lines.RemoveAll(x => x.addMovie.MovieID == addM.MovieID);