how to add Where condition for (where name in ('abc', 'des','kliop')) in .net API

how to add Where condition for (where name in ('abc', 'des','kliop')) in .net API

BTalayiBTalayi Posts: 18Questions: 4Answers: 0
edited October 2020 in Editor

Hi All,
I have a question about Where condition syntax in .NET library. I want to run this query:

Select age from table where name in ('abc', 'des','kliop')

based on the documentation here https://editor.datatables.net/manual/net/conditions I used this code:

 using (var db = new Database("sqlserver", sqlStr))
                {
                    var response = new Editor(db, "table", "ID")
                        .Model<pModel>()
                        .Where( "name", "('abc', 'des','klp')", "IN")
                        .Process(request)
                        .Data();
                    return Ok(response);
                }

and it gives me this error: "Incorrect syntax near '@where_0'."

Can you please advise?
Thanks

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.