Exemplo n.º 1
0
 public bool RemoveRating(string movieName, string nickName)
 {
     try
     {
         semaphore.WaitAsync();
         var movie = movieDataAcces.GetMovie(movieName);
         if (movie.UserRating == null)
         {
             return(false);
         }
         if (movie.UserRating.ContainsKey(nickName))
         {
             movie.UserRating.Remove(nickName);
             movie.UpdateRating();
             movieDataAcces.Update(movieName, movie);
         }
         return(true);
     }
     catch (DataBaseException)
     {
         return(false);
     }
     finally
     {
         semaphore.Release();
         var action = $"{nickName} removed his rating of {movieName}";
         loger.EventCreator("DELRATING", action);
     }
 }
Exemplo n.º 2
0
 public void Update(string oldName, Movie updatedMovie)
 {
     if (updatedMovie.Genres.Count() < 1)
     {
         throw new BussinesLogicException("Una pelicula debe tener uno o mas generos asociados");
     }
     movieDataA.Update(oldName, updatedMovie);
 }