Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for Queryable.Cast #211

Open
GoogleCodeExporter opened this issue Apr 24, 2015 · 3 comments
Open

Implement support for Queryable.Cast #211

GoogleCodeExporter opened this issue Apr 24, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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
    ).Single();

See also: 
http://groups.google.com/group/dblinq/browse_thread/thread/855c6fb79bc30616

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

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


Original issue reported on code.google.com by jonmpr...@gmail.com on 11 Mar 2010 at 1:33

@GoogleCodeExporter
Copy link
Author

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.

Original comment by anders...@gmail.com on 14 Mar 2010 at 12:42

@GoogleCodeExporter
Copy link
Author

As per http://groups.google.com/group/dblinq/msg/5663128659a64096, 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 ...
         ^^^^^^^^^^^

Original comment by jonmpr...@gmail.com on 15 Mar 2010 at 8:35

@GoogleCodeExporter
Copy link
Author

Please, try out the solution on the link below:
http://code.google.com/p/dblinq2007/issues/detail?id=132#c2

Original comment by tos.oliv...@gmail.com on 1 Apr 2012 at 1:20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant