views:

35

answers:

0

Hi Experts, I am working with linq to entities where I have a stored proc which returns an enetity based on some parameters. I can get this result in program. Now I want to join this resultset with similar entity on a common field.

my entity

Books
{
BookId,
Title
}

Stored Proc

GetFilterBooks(someparam)
(
   Select * from books where somefield = someparam

)

now I am trying to join both

var books = context.Books;
var filterBooks = context.GetFilterBooks(aaa);

var xx = (from b in books
                    join bl in filterBooks 
                    on b.BookId equals bl.BookId
                    select b).ToList()

This gives me error Unable to create a constant value of type 'System.Collections.Generic.IEnumerable`1'.
Only primitive types ('such as Int32, String, and Guid') are supported in this context.