I have a linq query that returns multiple rows from a table and I would like to get count of number of rows and also change the results from System.Data.Entity.Infrastructure.DbQuery to List. strUserID is not the primary key to customer services table.

```
var AllCustomerServices = from service in _context.CustomerServices
    where service.strUserID == Session["userID"].ToString()
    select service;

```

It is throwing exception for following code:

```
if (AllCustomerServices.Count() > 0)
{
    List<CustomerServices> cstSrvs = AllCustomerServices.ToList();
}

```

Exception:

> 
> 'AllCustomerServices.ToList()' threw an exception of type 'System.NotSupportedException'
>  [NotSupportedException: LINQ to Entities does not recognize the method 'System.Object get\_Item(System.String)' method, and this method cannot be translated into a store expression.]
> 
> 
>