Beispiel #1
0
        static void Main(string[] args)
        {
            Program._configuration = setConfiguration();
            TodoClient TodoClient = new TodoClient(Program._configuration);

            try
            {
                System.Console.WriteLine("Hello World!");

                TodoItemPublic todo = new TodoItemPublic();
                todo.Name       = "a fresh one";
                todo.IsComplete = false;
                todo.User       = new TodoApi.Shared.User
                {
                    Id        = 4,
                    FirstName = "",
                    Fullname  = "",
                    LastName  = ""
                };
                var item = TodoClient.Create(todo).Result;
                System.Console.WriteLine(item.Name);


                List <TodoItemPublic> todos = TodoClient.Getall().Result;


                System.Console.WriteLine(" after get all new attempt");
                foreach (TodoItemPublic _todo in todos)
                {
                    System.Console.WriteLine(_todo.Name);
                }
                System.Console.WriteLine("Sleeping");
                Thread.Sleep(Timeout.Infinite);
            }
            catch (Exception e) {
                System.Console.WriteLine(e.ToString());
            }
        }