Example #1
0
 public void Update(Film film)
 {
     this.Title = film.Title;
     this.Plot = film.Plot;
     this.PosterUrl = film.PosterUrl;
     this.ExternalUrl = film.ExternalUrl;
 }
        /// <summary>
        /// Saves the review asynchronous.
        /// </summary>
        /// <param name="film">The film.</param>
        public void SaveReviewAsync(Film film)
        {
            if (context.Films.Count(f => f.Id == film.Id) != 0)
            {
                context.Films.Single(f => f.Id == film.Id).Update(film);
            }
            else
            {
                context.Films.Add(film);
            }

            context.SaveChangesAsync();
        }
 /// <summary>
 /// Deletes the review asynchronous.
 /// </summary>
 /// <param name="film">The film.</param>
 public void DeleteReviewAsync(Film film)
 {
     context.Films.Remove(film);
     context.SaveChangesAsync();
 }