iqueryable not working?

Jun 13, 2009 at 5:18 AM

is IQueryable working? i tried this

public static IQueryable SearchUser(String userName, String firstName, String lastName)
 {
   using (ParkingDataContext context = new ParkingDataContext())
   {
     IQueryable result = 
     from r in context.users
     where r.UserName.Contains(userName)
     && r.FirstName.Contains(firstName)
     && r.LastName.Contains(lastName)
     orderby r.DateAdded descending
     select r;
     return result;
   }
}

but unfortunately it doesn't work but

 

when i try this

 

public static List<user> SearchUser(String userName, String firstName, String lastName)
{
using (ParkingDataContext context = new ParkingDataContext())
{
varresult =
from r in context.users
where r.UserName.Contains(userName)
&& r.FirstName.Contains(firstName)
&& r.LastName.Contains(lastName)
orderby r.DateAdded descending
select r;
return result.ToList();
}
}

it works,

and i tried checking for mysql logs if it queried the database but unfortunately it doesn't query anything if i use IQueryable
Jun 16, 2009 at 2:25 AM

Should work... both code samples above end up going through the IQueryable interface.  Very strange, could very well be a bug.