1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DapperでのIN句(fsharp)

Last updated at Posted at 2020-06-04

Summary

DapperでIN句

メモ書き

Sql

(
  CASE
    WHEN (@LenFoo = 0 ) THEN
      true
    ELSE
      tbl.AAA IN @Foo
  END
)

or

((tbl.AAA in @Foo) or (@LenFoo = 0)

fsharp

{|
  Foo = foo
  LenFoo = List.length( foo )
|}
|> fun x -> con.Execute(sql,x) |> ignor

foo list の中身

[]
["aaa"]

ref

https://github.com/StackExchange/Dapper#list-support
https://stackoverflow.com/questions/18690395/check-null-for-list-parameter-in-dapper

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?