My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 211: Implement support for Queryable.Cast
1 person starred this issue and may be notified of changes. Back to list
Status:  Accepted

Sign in to add a comment
Project Member Reported by, Mar 11, 2010
What steps will reproduce the problem?
1. Create a query that contains a cast, and run it

    Edu.EventStaff newEventStaff = new Edu.EventStaff();
    newEventStaff.Staff = (from Edu.Staff staffMember
        in EduDContext.Staff
        where staffMember.ContactID == (int)currentBooking.EduContactID
        select staffMember

See also:

What is the expected output? What do you see instead?
Expected output is no exception (or a reasonable exception if there is no 

Actual output is: S0133: Implement QueryMethod Queryable.Cast.

Mar 13, 2010
Project Member #1
I was not able to reproduce using the northwind database and this query:

object empId = 1;
var et = new EmployeeTerritories();
et.Employees = (from e in nwind.Employees
                where e.ReportsTo == (int)empId
                select e).Single();

So there seems to be a bit more to it.
Mar 15, 2010
Project Member #2
As per, it looks like the 
problem is that a type is declared in the 'from' expression:

    from Edu.Staff staffMember in EduDContext.Staff ...

as opposed to the more "normal"

    from staffMember in EduDContext.Staff ...

Mar 31, 2012
Please, try out the solution on the link below:
Sign in to add a comment

Powered by Google Project Hosting