I have a simple sql query that can take in multiple arrays of type Integer, if I do something like this it works r.userid in(36,37,38) I left out some of the code since everything works correctly unless I try to pass it in as a List . I am new to npgsql so I am sure I am missing something any suggestions would be great .
This works
select s.post,s.fullname,s.location,s.streetplace,s.streetplace_id,s.profile_id as
,s.link,s.title FROM streams s JOIN reshares r on r.userid in(36,37,38)
however if I do something like this
This does not work
var newList = new List<int>{ 36,37,38 };
select s.post,s.fullname,s.location,s.streetplace,s.streetplace_id,s.profile_id as
,s.link,s.title FROM streams s JOIN reshares r on r.userid in(@following)
cmd.Parameters.AddWithValue("@following", newList);
I get the error
42883: operator does not exist: integer = integer[] at Npgsql.NpgsqlConnector.
No operator matches the given name and argument type(s). You might need to add explicit type casts.