private static void GetAllCustomers()

in FMLab/ODataConsoleApplication/Program.cs [112:136]


        private static void GetAllCustomers()
        {
            //Using the DataServiceContext class, we can simply perform a LINQ query to retrieve all Customers from the Customer entity. 
            //This internally will issue web request by using the URI that represents OData protocol
            var query = from customer in context.Customers
                        select customer;

            
            Console.ForegroundColor = ConsoleColor.Cyan;         
            //Display the http request Uri that was sent to fetch all customers
            Console.WriteLine("Request Uri: " + query.ToString());
            Console.ForegroundColor = ConsoleColor.White;            

            Console.WriteLine();

            //After retrieving all the customers, iterate through the collection and print each one.
            foreach (Customer c in query)
            {
                Console.WriteLine("Customer.RecId: " + c.RecId);
                Console.WriteLine("First Name: " + c.FirstName);
                Console.WriteLine("Last Name: " + c.LastName);

                Console.WriteLine("++++++++");
            }
        }