Esempio n. 1
0
        static void AddProduct(Default.Container container, ProductService.Models.Product product)
        {
            container.AddToProducts(product);
            var serviceResponse = container.SaveChanges();

            foreach (var operationResponse in serviceResponse)
            {
                Console.WriteLine("Response: {0}", operationResponse.StatusCode);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // TODO: Replace with your local URI.
            string serviceUri = "http://localhost:56321/";
            var    container  = new Default.Container(new Uri(serviceUri));

            var product = new ProductService.Models.Product()
            {
                Name     = "Yo-yo",
                Category = "Toys",
                Price    = 4.95M
            };

            AddProduct(container, product);
            ListAllProducts(container);
        }
        static void Main(string[] args)
        {
            // TODO: Replace with your local URI.
            string serviceUri = "http://localhost:54155/";
            var    container  = new Default.Container(new Uri(serviceUri));

            var product = new ProductService.Models.Product()
            {
                Name     = "figet spinner",
                Category = "Toys",
                Price    = 5.00M
            };

            AddProduct(container, product);
            ListAllProducts(container);

            Console.ReadKey();
        }