Reserved query cases

Code samples
Table of Contents
Determine the number of entities returned by a query
How to do it
// Create the DataServiceContext using the service URI.
TrainingEntities context = new TrainingEntities(new Uri("http://localhost/TrainingService1/"));

// Define a new query for Customers.
DataServiceQuery<Customer> query = context.Customers;

    // Execute the query to just return the value of all customers in the set.
    int totalCount = query.Count();

    // Retrieve the total count from the response.
    Console.WriteLine("There are {0} customers in total.", totalCount);
catch (DataServiceQueryException ex)
    throw new ApplicationException("An error occurred during query execution.", ex);