I have a stored procedure:
CREATE OR REPLACE PROCEDURE insert_participant(j json)
LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO participant (procedure_id,lot_id)SELECT procedure_id,lot_id FROM json_populate_record(null::participant, j);
COMMIT;
END;
$$;
And a class:
public class Participant : BaseEntity
{
[Key]
public int Procedure_id{ get; set; }
public int Lot_id { get; set; }
}
I'm trying the following:
public void Add(Participant item)
{
using (IDbConnection dbConnection = Connection)
{
dbConnection.Open();
dbConnection.Execute("insert_participant", item, commandType: CommandType.StoredProcedure);
}
}
But it fails and tells that there is no stored procedure with these paremeters.
What kind of parameter should I define when creating stored procedure in order for this to work?