hi, i'm working with LLBLGEN pro 5.0 and use both Access and Sql Server. When creating a linq expression with a null coalescing operator in an IQueryable, for instance:
... LandId = LandId ?? 0,
(First LandId is int, second (database property) LandId is Nullable<int>)
then this gets converted to
COALESCE([LPA_L4].[LandID],
@p2) AS [LandId],
in SQL code in both Access and Sql Server. But this is not supported in Access. I have managed to work around this by using the following syntax:
... LandId = (LandId ==null ? 0 : LandId )
This gets rather problematic because I use the former syntax a lot and everytime I use this in IQueryables I discover my mistakes only in runtime.
When using Nullable<int> to int this gets even more cumbersome for I have to cast the last expression LandId to int as per
... LandId = (LandId ==null ? 0 : (int)LandId )
that would probably transformed to something like:
... IIF(IIF(([LPA_L4].[LandID] IS NULL),
1,
0) = 1,
@p2,
[LPA_L4].[LandID]) AS [LandId],
Could you please generate the same SQL as you would in second example for the first null coalesce expression? For Access databases only.