How do I use the SQL WHERE IN construct with PetaPoco?

This will work except you can’t use the @0 (ordinal) syntax. You must use named parameters, otherwise it thinks they are individual parameters. var tagsToFind = new string[] { “SqlServer”, “IIS” }; var sql = PetaPoco.Sql.Builder.Select(“*”).From(“Tags”).Where(“Name in (@tags)”, new { tags = tagsToFind }); var result = db.Query<Tag>(sql); This will result in select * from … Read more