When I run this query on the database
select S.IS_END_STAGE
from stage s
where S.ID = 1653;
I get the result 1 of type Number.
I thought this query should produce the same result but it returns null.
using LLBL.FactoryClasses;
using SD.LLBLGen.Pro.QuerySpec;
using LLBL.HelperClasses;
...
var qf = new QueryFactory();
var q = qf.Stage.Select(() => new {isNextStageEndStage = StageFields.IsEndStage.ToValue<Int32>()}).Where(StageFields.Id == 1653);
This variation also produces the same null result:
var q = qf.Create().Select(() => new {isNextStageEndStage = StageFields.IsEndStage.ToValue<Int32>()}).Where(StageFields.Id == 1653);
The watch on q yields this result at runtime:
q {SELECT
With projection:
Field: StageEntity.Id
WHERE
PredicateExpression:
PredicateExpression:
Predicate:
FieldCompareValuePredicate:
Field:
Field: StageEntity.Id
Equal
Constant: 1653
Additional information:
Offset: 0
Alias: ''
CacheResultset: False
} SD.LLBLGen.Pro.QuerySpec.DynamicQuery<<>f__AnonymousType0<int>>
What am I not doing correctly?
Specs:
Visual Studio 2010 Professional version 10.0.40219.1 SP1Rel
LLBLGen Pro Version 4.0 Final using the "as 32 bit application" shortcut
Development Machine Windows 7 Professional- 64 bit - Service Pack 1
Target Database: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
Project Settings: Target Framework LLBL Gen Pro Runtime Framework, target C#, .Net 4.0
Template Group Adapter, preset SD.Presets.Adapter.General