DROP PROCEDURE dbo.sp_xxx;
create procedure dbo.sp_xxx @DossierId INT
AS
DELETE FROM Winning WHERE dossierId = @DossierId
DELETE FROM Dossier WHERE Id = @DossierId
EXEC dbo.sp_xxx@DossierId = 536244;
//appel d'une procédure stockée
Entities ep1 = Entities.GetEntities();
DbCommand cmd = ep1.Database.Connection.CreateCommand();
var parameter = cmd.CreateParameter();
parameter.ParameterName = "@DossierId";
parameter.Value = 536244;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.sp_xxx";
{
cmd.Connection.Open();
Console.WriteLine($"resultat : {cmd.ExecuteNonQuery()}");
} catch (Exception e)
{
Console.WriteLine(e);
} finally
{
if (cmd.Connection.State == ConnectionState.Open)
cmd.Connection.Close();
}