Last active
December 29, 2015 21:29
-
-
Save kiyokura/7730436 to your computer and use it in GitHub Desktop.
DapperでIN句にさくっとリストをバインドする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cn.Open(); | |
var param = new | |
{ | |
// IN句に並べたい値をリストとして積んでやる | |
AgeList = new List<int>() { 20, 38 } | |
}; | |
var ret = cn.Query<UserEntity>("SELECT * FROM Users WHERE Age IN @AgeList ORDER BY ID", param).ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment