On Mar 15, 12:00 am, Watermelons <[email protected]> wrote:
> staffMember.ContactID is an int and currentBooking.EduContactID is a
> nullable int, so I tried declaring local variable
> int currContactID = (int)currentBooking.EduContactID;
>
> then as you pointed out Jon,
> Edu.EventStaff newStaff = new Edu.EventStaff()
>         {
>             Staff = (from Edu.Staff staffMember in EduDContext.Staff
>                      where staffMember.ContactID == currContactID
>                      select staffMember).Single(),
>         };
>
> I still get the same exception. Must be a bug in DbLinq, now I just
> have to try to figure out how to fix the bug!!
Ah, just noticed that it's Queryable.Cast (not just any Cast). So the
casts in the where clause was probably not the problem, instead remove
the "Edu.Staff" from the from-clause of the query expression. At least
I could reproduce the exception like this:
var t = (from Employees e in nwind.Employees
         select e).ToList();
--
Anders

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to