tags:

views:

174

answers:

0

We have this:

repository.Add<Customer>(c);
...
IQueryable<Customer> result1 = repository.All<Customer>();
Console.WriteLine( result1.Count() );
IQueryable<ICustomer> result2 = result1.Cast<ICustomer>();
Console.WriteLine( result2.Count() ); // error here

Expression of type 'System.Collections.Generic.IEnumerable1[Data.Customer]' cannot be used for parameter of type 'System.Linq.IQueryable' of method 'System.Linq.IQueryable1[Data.ICustomer] CastICustomer'

Is it possible to work via interfaces?