Closed tforkmann closed 3 years ago
This should work.
let getIdsAndDescriptions (conn: IDbConnection)=
task {
let mandant = int16 999
let! ids =
select {
for e in enmsTabelle do
join datapoints in enmsSichtDatenpunkte on (e.Sakto = datapoints.Sakto)
where (
datapoints.Mandant = mandant &&
isIn datapoints.USER_KstEbene [ "Contracting";"BGA";"KW" ])
distinct
}
|> conn.SelectAsync<{| Saktobez: string ; Sakto : string ; USER_KstEbene : string |}>
return ids |> Seq.toArray
}
I think I missed your intent. To implement that you would need to stub out the new operator, and then check for it alongside the
isIn
/ isNotIn
MethodCall
handler. That's just a guess - not sure if it would be a straightforward add.
Thanks @JordanMarr!
I think the isIn
operator is totally fine.
Didn't know those operators work for then LINQ queries stlye as well.
Closing!
I'm trying to convert SqlProvider queries to Dapper.FSharp queries.
In Sqlprovider you can use
|=|
as an IN operator in the where clause.Would be nice if I could do something like that with Dapper.FSharp.
I tried this which obviously does not work:
Any idea how to implement that?