Hi,
with the latest LLBLGen (20th may) this query doesn't seem to work, as it doesn't return any entities:
var elementEntities = from element in _data.Element
where element.PublicationDate <= DateTime.Now
&& element.ArchiveDate == null
select element;
However this works:
var elementEntities = from element in _data.Element
where element.PublicationDate <= DateTime.Now.AddTicks( 1 )
&& element.ArchiveDate == null
select element;
In the first situation, no date at all is passed to the SQL
( Query: SELECT DISTINCT TOP(@top0) COUNT(*) AS [LPAV_] FROM [TEST_CC_ORM].[dbo].[gtb_Element] [LPLA_1] WHERE ( ( ( ( ( [LPLA_1].[__pub_date] IS NULL) AND ( [LPLA_1].[__arch_date] IS NULL)))))
Parameter: @top0 : Int64. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 1 )
but in the second there is:
Query: SELECT DISTINCT TOP(@top0) COUNT(*) AS [LPAV_] FROM [TEST_CC_ORM].[dbo].[gtb_Element] [LPLA_1] WHERE ( ( ( ( ( [LPLA_1].[__pub_date] <= @PublicationDate2) AND ( [LPLA_1].[__arch_date] IS NULL)))))
Parameter: @top0 : Int64. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 1.
Parameter: @PublicationDate2 : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 28-5-2008 16:55:45.
Seems like DateTime.Now is recognized as an expression but doesn't get translated to something like GETDATE()?
Best Regards,
Wiebe