Exemplo n.º 1
0
        private static void EnterJoke(Joke joke = null)
        {
            if (joke == null)
            {
                joke = new Joke();
            }

            Console.WriteLine("The joke's title:");
            joke.Title = Console.ReadLine();

            Console.WriteLine("Question:");
            joke.Question = Console.ReadLine();

            Console.WriteLine("Answer:");
            joke.Answer = Console.ReadLine();

            if (joke.Id != 0)
            {
                _service.UpdateJoke(joke);
            }
            else
            {
                _service.AddJoke(joke);
            }
        }
Exemplo n.º 2
0
 public void AddJoke(Joke joke)
 {
     _serviceClient.AddJoke(joke);
 }