title: Running Postgres stored procedure with C#
body: <p>I created a stored procedure <code>stocks.public.daily_actions_full()</code> that not receive or return something, it just inserts data from a view to a table.</p>
  <p>After using using <code>dbcontext scaffold</code> all the tables and views were added except the stored procedures.</p>
  <p>I saw that it's a known issue and the option to call stored procedures is to use <code>ExecuteSqlCommand</code>.</p>
  <p>I tried the following code:</p>
  <pre><code>using (var db = new stocksContext())
  {
      var rowsAffected = db.Database.ExecuteSqlCommand(&quot;CALL stocks.public.daily_actions_full()&quot;);
  }
  </code></pre>
  <p>But I'm getting the following error:</p>
  <p><a href="https://i.stack.imgur.com/RX6RW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RX6RW.png" alt="error" /></a></p>
  <p>Not sure what I'm missing here or if there's another way to call stored procedures.</p>
  <p>Maybe adding it to the context file manually? (Couldn't find how)</p>
  <p>Thanks!</p>