title: Calling Stored Proc in EF 6 with output parameters?
body: <p>I have an MVC 5 project that I'm trying to figure out how to call an Oracle stored proc that has output parameters. I've done some searching and this is the closest I've come but I get an error that it is invalid SQL. </p>
  
  <p>Even if I get it to run successfully, I'm assuming it will pass the out put values to the results object and have an IsValid and Remarks properties populated?</p>
  
  <pre><code>public class ValidateCSPolicyResult
  {
      public string IsValid { get; set; }
      public string Remarks { get; set; }
  }
  
  using (var ctx = new DataContext())
  {
  
      var empId = new SqlParameter("@empId", employeeId);
      var startDate = new SqlParameter("@startDate", startDateTime);
      var endDate = new SqlParameter("@endDate", endDateTime);
      var swapEmpId = new SqlParameter("@swapEmpId", swapEmployeeId);
  
      var isValid = new SqlParameter
      {
          ParameterName = "Valid",
          Value = "N",
          Direction = ParameterDirection.Output
      };
  
      var remarks = new SqlParameter
      {
          ParameterName = "Remarks",
          Value = "",
          Direction = ParameterDirection.Output
      };
  
  
      var results = ctx.Database.SqlQuery(ValidateCSPolicyResult)("VALIDATE_CSW_POLICY  @empId, @startDate, @endDate, @swapEmpId, @Valid out, @Remarks out").FirstOrDefault();
  
  }
  </code></pre>