Пример #1
0
        public IEnumerable <string> Execute(IEnumerable <string> input)
        {
            var parameters = input.ToList();

            cinemaConsole.Clear();
            cinemaConsole.WriteLineMiddle("Type a genre name:\n");

            try
            {
                var genreName = cinemaConsole.ReadLineMiddle().TrimEnd().TrimStart();
                Validations(genreName);
                genreServices.DeleteGenre(genreName);
                cinemaConsole.HandleOperation("\nSuccessfully deleted from database");
                return(parameters.Skip(1));
            }
            catch (InvalidClientInputException e)
            {
                cinemaConsole.HandleException(e.Message);
                return(parameters.Skip(1));
            }
            catch (EntityDoesntExistException e)
            {
                cinemaConsole.HandleException(e.Message);
                return(parameters.Skip(1));
            }
        }
Пример #2
0
 public bool Delete(string genre_style)
 {
     if (genre_style != null)
     {
         return(_genreServices.DeleteGenre(genre_style));
     }
     return(false);
 }
Пример #3
0
 public void Delete(Guid id)
 {
     _services.DeleteGenre(id);
 }