Where clause failing

Posts   
 
    
JayBee
User
Posts: 275
Joined: 28-Dec-2006
# Posted on: 11-May-2016 21:54:45   

Hi,

I'm on LLGBLGen 4.1, self servicing. I'm using the QueryFactory stuff for the fist time, trying out some examples on my own databases.

When I try the following for a table named Log:

var qf = new QueryFactory();
var q = qf.Log.Where(LogFields.DateTimeCreated == first);

I get an error complaining there is no definition for Where. What am I doing wrong.

Thanks, Jan

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 11-May-2016 22:56:43   

Please provide the stacktrace and exception and what 'first' is. I've moved the thread as queryspec != linq wink

Frans Bouma | Lead developer LLBLGen Pro
JayBee
User
Posts: 275
Joined: 28-Dec-2006
# Posted on: 12-May-2016 09:26:41   

There is no stacktrace. Intellisense / the compiler gives the message. I have the following usings in my program:

using System; using System.Collections.Generic; using System.Linq; using HITc.ACSLog.EntityClasses; using HITc.ACSLog.HelperClasses; using HITc.ACSLog.CollectionClasses; using HITc.ACSLog.TypedViewClasses; using HITc.ACSLog.FactoryClasses; using SD.LLBLGen.Pro.ORMSupportClasses; using SD.LLBLGen.Pro.LinqSupportClasses; using SD.LLBLGen.Pro.QuerySpec.SelfServicing;

and the following references:

SD.LLBLGen.Pro.DQE.SqlServer SD.LLBLGen.Pro.ORMSupportClasses

first is a DateTime variable.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 12-May-2016 09:51:02   

Please add

using SD.LLBLGen.Pro.QuerySpec;

The 'Where' method is a queryspec extension method simple_smile

Frans Bouma | Lead developer LLBLGen Pro
JayBee
User
Posts: 275
Joined: 28-Dec-2006
# Posted on: 12-May-2016 10:30:39   

That solved this problem!