title: Entity Framework Core - Using Stored Procedure with output parameters
body: <p>I'm trying to use stored procedures with new Entity Framework Core. I need to start new project soon which will be ASP.Net 5, but not sure if Entity Framework will fit for the job. The application will be triggering several stored procedures per minute and I need output parameters. Will EF be good for this or should I use ADO.Net?</p>
  
  <p>I have tried FromSql and database.ExecuteSqlCommand but no luck.</p>
  
  <pre><code>using (AppDbContext db = factory.Create())
          {
              var in1 = new SqlParameter
              {
                  ParameterName = "ParamIn1",
                  DbType = System.Data.DbType.Int64,
                  Direction = System.Data.ParameterDirection.Input
              };
              var in2 = new SqlParameter
              {
                  ParameterName = "ParamIn2",
                  DbType = System.Data.DbType.String,
                  Direction = System.Data.ParameterDirection.Input
              };
              var out1 = new SqlParameter
              {
                  ParameterName = "ParamOut1",
                  DbType = System.Data.DbType.Int64,
                  Direction = System.Data.ParameterDirection.Output
              };
              var out2 = new SqlParameter
              {
                  ParameterName = "ParamOut2",
                  DbType = System.Data.DbType.String,
                  Direction = System.Data.ParameterDirection.Output
              };
  
              var result = db.Database.ExecuteSqlCommand("exec spTestSp", in1, in2, out1, out2);
          }
  </code></pre>