Using Simple.Data how can I pass multiple values to a query?
Example generated SQL:
SELECT a,b,c
FROM GreatTable
WHERE x in (1,2,3)
Join support would be nice, too.
Does Simple.Data allow this sort of thing?
Using Simple.Data how can I pass multiple values to a query?
Example generated SQL:
SELECT a,b,c
FROM GreatTable
WHERE x in (1,2,3)
Join support would be nice, too.
Does Simple.Data allow this sort of thing?
If you have no gaps in your values e.g. 1,2,3,4 then use:-
var list = db.GreatTable.FindAllByX(1.to(4));
this produces a where x BETWEEN 1 AND 4
Otherwise if you have gaps in your range, e.g. 1,2,4,6 then use an integer array:-
var list = db.GreatTable.FindAllByX(new[] { 1, 2, 4, 6 });
this produces a where x IN (1,2,4,6)