Executing a PostgreSQL Database Package's Function within C# code using LINQ

144 views Asked by At

I am wondering if anyone knows how exactly to go about calling a Package's function within C# code(within a repository class), specifically using LINQ? I have created a package with the help of EDB Postgres documentation. All it does is query a particular database table for the latest value in a particular column. I created and saved the Package into the schema that the table is a part of, but not to the table itself (if that makes sense). What exactly is the process to access a Package's function using LINQ or perhaps another means? EDB Postgres documentation has no examples like this, and similar answers online are for very different circumstances and I was unable to modify them to fit my needs.

1

There are 1 answers

0
JPho On

Ok, seems like the package and its function can alternatively be called by using the DbFunctionCall() method, which takes in a schemaName, functionName, and optional functionName parameters (in case anyone runs into a similar issue).