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

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

            var product = new ODataService.Models.Product()
            {
                Name = "Dave",
                ID   = 12
            };

            AddProduct(container, product);

            ListAllProducts(container);

            Console.WriteLine("Done");

            Console.ReadLine();
        }