private static void AddDeck(ref DeckService deckService) { Console.WriteLine("Enter a name for the new deck: "); var name = Console.ReadLine(); Console.WriteLine($"How many card will {name} contain? "); ushort capacity; try { capacity = ushort.Parse(Console.ReadLine() !); } catch (Exception) { Console.WriteLine("Input error."); return; } var result = deckService.AddDeck(name, capacity); Console.WriteLine(result.Message); }