I am migrating c# application to support Npgsql/postgres. The back end of the application uses SQL Server. Now we need to support Postgres. I am using third party library which is Npgsql (4.0.10). I had converted most of the items in the code but I am stuck with migrating the following code to use Npgsql library.
List<int> cidList = <filled list>;
List<SqlDataRecord> contList = new List<SqlDataRecord>();
SqlMetaData[] tvpDef = { new SqlMetaData("n", SqlDbType.Int) };
foreach (int i in cidList)
{
SqlDataRecord rec = new SqlDataRecord(tvpDef);
rec.SetInt32(0, i);
contList.Add(rec);
}
...
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@CIDList", SqlDbType.Structured);
cmd.Parameters["@CIDList"].Direction = ParameterDirection.Input;
cmd.Parameters["@CIDList"].TypeName = "IntKeyTable";
cmd.Parameters["@CIDList"].Value = contList;
I am not finding the equivalent of SqlDataRecord and SqlMetaData in Npgsql. Does npgsql has support to these SqlDataRecord and SqlMetaData class?. Any help is really appreciated.