I am using EF7 (entity framework core) in an asp.net core App. Can you please point me to the proper way of executing stored procedures? The old method with
((IObjectContextAdapter)this).ObjectContext.ExecuteFunction is not working.
Stored procedure support is not yet (as of 7.0.0-beta3) implemented in EF7. You can track the progress of this feature using issue #245.
For now, you can do it the old fashioned way using ADO.NET.
var connection = (SqlConnection)context.Database.AsSqlServer().Connection.DbConnection; var command = connection.CreateCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "MySproc"; command.Parameters.AddWithValue("@MyParameter", 42); command.ExecuteNonQuery();