I write this method:
public List<TResult2> SelectAndJoin<TOuter, TInner, TKey, TResult, TResult2>(IEnumerable<TInner> inner,
System.Linq.Expressions.Expression<Func<Regions, TKey>> outerKeySelector,
System.Linq.Expressions.Expression<Func<TInner, TKey>> innerKeySelector,
System.Linq.Expressions.Expression<Func<Regions, TInner, TResult>> resultSelector,
Func<Regions, TResult2> selector)
{
using (RepositoryDataContext = new DataClasses1DataContext())
{
return RepositoryDataContext.Regions.Join(inner, outerKeySelector, innerKeySelector, resultSelector).AsEnumerable<TResult2>().Select<Regions, TResult2>(selector).ToList<TResult2>();
}
}
but the expression follow return has this Error:
'System.Linq.IQueryable' does not contain a definition for 'AsEnumerable' and the best extension method overload 'System.Linq.Enumerable.AsEnumerable(System.Collections.Generic.IEnumerable)' has some invalid arguments
How I can get rid of this error?
is this code standard?
thanks