예제 #1
0
        public void AddComment(View.Comment comment)
        {
            // Find movie
            var movie = DB.Movies
                        .Include(m => m.Comments)
                        .FirstOrDefault(m => m.Id == comment.MovieId);

            // If the movie exists add the comment
            if (movie != null)
            {
                movie.Comments.Add(new Comment()
                {
                    Text   = comment.Text,
                    Author = comment.Author,
                    Date   = comment.Date,
                });
            }
            DB.SaveChanges();
        }
예제 #2
0
 public void AddComment(View.Comment comment)
 {
     throw new NotImplementedException();
 }