title: Call stored procedure to input data in database from ASP.NET Web API?
body: <p>I want to insert the data from ASP.NET Web API to my data in SQL Server in pre defined table. First I am getting response after calling REST API and want to insert the response in table in database.</p>
  <p>API Controller</p>
  <pre><code>[HttpGet]
  public async Task&lt;IActionResult&gt; GetOutput(int id)
  {
      string CheckJob = &quot;exec sp_GetJob &quot;+ &quot;@id= &quot; + id;
  
      var result = _context.Job.FromSqlRaw(CheckJob).ToList().FirstOrDefault();
      if(result == null){
          string InsertResult = &quot;exec sp_add&quot; + &quot;@result = &quot; + result;
          _context.FromSqlRaw(InsertResult);  &lt;-- Don't know how to call stored procedure
      }
  
      return Ok(result);
  }
  </code></pre>
  <p>Stored Procedure</p>
  <pre><code>create procedure sp_add @result int
  as
  begin 
      insert into School(id, created_date)
          values (@result, GetDate());
  end
  </code></pre>
  <p>I am facing issue in calling stored procedure to insert data. Can somebody please help me out?</p>
  <p>Thank you</p>