title: Stored Procedure call not working Entrity Framework 5 code first
body: <p>I have a stored procedure in my database:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[DeletePaySlip]
      @PayRunId BIGINT,
      @EmployeeId BIGINT
  AS
  BEGIN
      DECLARE @PaySlipId BIGINT   
  
      BEGIN TRY
          SELECT @PaySlipId = Id 
          FROM PYREmployeePaySlip 
          WHERE PayRunId = @PayRunId AND EmployeeId = @EmployeeId
  
          BEGIN TRANSACTION t1
  
          IF  @PaySlipId IS NOT NULL
          BEGIN
              DELETE FROM PYREmployeePaySlipDetail WHERE PaySlipId = @PaySlipId
              DELETE FROM PYREmployeePaySlip WHERE Id = @PaySlipId
          END
  
          COMMIT TRANSACTION t1
      END TRY
      BEGIN CATCH
          ROLLBACK TRANSACTION t1
      END CATCH; 
  
  END
  </code></pre>
  
  <p>If I execute the stored procedure from SQL query window, it works.</p>
  
  <p>Now I am trying to call the stored procedure from C# code</p>
  
  <pre><code> public bool DeleteEmployeePaySlip(long payRunId, long employeeId)
   {
              bool success = true;
              var sqlparamPayRunId = new SqlParameter("@PayRunId", payRunId);
              var sqlparamEmployeeId = new SqlParameter("@EmployeeId", employeeId);
  
              using (var dbContext = new CRMDbContext())
              {                
                  try
                  {
                      var res = dbContext.Database.SqlQuery&lt;Object&gt;("EXEC DeletePaySlip @PayRunId, @EmployeeId",
                                                         sqlparamPayRunId,
                                                         sqlparamEmployeeId);
                  }
                  catch (DbEntityValidationException e)
                  {
                      foreach (var eve in e.EntityValidationErrors)
                      {
                          foreach (var ve in eve.ValidationErrors)
                          {
  
                          }
                      }
                      throw;
                  }
              }
  
              return success;
          }
  </code></pre>
  
  <p>When I call the method above, it does not throw any error. But the stored procedure not seems to be called.</p>