Hi,
LLBLGen 5.8 adapter
What is the recommended way to get the following sql where clause :
declare
@i int
set @i = null
select 1 where @i in (1,2)
There is a memory Contains
as per https://www.llblgen.com/Documentation/5.9/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Linq/gencode_linq_generalusage.htm#queryable-contains
However @i
is nullable so, if that were a nullable column we would have in C#
var someInMemoryArray = new int[] {1,2};
q.Where(a => someInMemoryArray.Contains(a.SomeNullableIntColumn)
However C# does not like that due to the mix of int[]
and IQueryable<int?>
, i.e. int
and int?
:
Severity Code Description Project File Line Suppression State
Error CS1929 'int[]' does not contain a definition for 'Contains' and the best extension method overload
'Queryable.Contains<int?>(IQueryable<int?>, int?)' requires a receiver of type 'IQueryable<int?>'
Do I just copy the in memory array to another int?[]
first?
Thanks,