This question is locked. New answers and comments are not allowed.
I am getting the following error:
An expression of type XXXX is not allowed in a subsequent from clause in a query expression with source type 'System.Linq.IQueryable<XXXX>'. Type inference failed in the call to 'SelectMany'
I am extremely new to LINQ. I have been using SQL queries with the Open Access SQL API which has been working great. But I want to learn to use LINQ so I a researching and forcing myself to do this.
I found the following articles which describes how LINQ handles relationships between tables. This is where I was struggling the most and this article does a great job of explaining it. http://msdn.microsoft.com/en-us/library/bb386932.aspx
So I am trying to duplicate this, but using OpenAccess ORM.
So this is my query:
u.UserGroups is throwing the error. Intelisense shows me the UserGroups object but doesn’t like something I am doing… Would someone be able to help me identifying what is causing this error please…
Thanks in advance.
Duncan
An expression of type XXXX is not allowed in a subsequent from clause in a query expression with source type 'System.Linq.IQueryable<XXXX>'. Type inference failed in the call to 'SelectMany'
I am extremely new to LINQ. I have been using SQL queries with the Open Access SQL API which has been working great. But I want to learn to use LINQ so I a researching and forcing myself to do this.
I found the following articles which describes how LINQ handles relationships between tables. This is where I was struggling the most and this article does a great job of explaining it. http://msdn.microsoft.com/en-us/library/bb386932.aspx
So I am trying to duplicate this, but using OpenAccess ORM.
So this is my query:
var idQuery = from u
in
dbContext.Users
from c
in
u.UserGroups
where u.CredentialsID == 0
select
new
{
u.UserID,
u.FirstName,
u.MiddleName,
u.LastName,
u.Gender,
u.Birthday,
u.CreatedOn
};
u.UserGroups is throwing the error. Intelisense shows me the UserGroups object but doesn’t like something I am doing… Would someone be able to help me identifying what is causing this error please…
Thanks in advance.
Duncan