User-832373396 posted
<g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="13" data-gr-id="13">Hi</g> <g class="gr_ gr_12 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="12" data-gr-id="12">kishore</g>,
At first, DELETE queries, that to use the ExecuteSqlCommand, which is similar to FromSql, and returns <g class="gr_ gr_14 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="14" data-gr-id="14">int</g>,
the affected rows.
ep.
var a =await _northWindDbContext.Database.ExecuteSqlCommandAsync("usp_CreateShipper @p0, @p1",
parameters: new[] { "hello", "world" });
Sir, please change a bit with your current code.
var parameters = new []
{
new SqlParameter("@returnVal", (object)param1),
new SqlParameter("@returnVal", (object)param2),
new SqlParameter("@returnVal", (object)param3),
..........
};
var b = await _stagingContext.Database.ExecuteSqlCommandAsync("exec proacName",parameters);
to
var parameters = new []
{
(object)param1,
(object)param2,
(object)param3,
..........
};
var b = await _stagingContext.Database.ExecuteSqlCommandAsync("proacName @returnVal,@returnVal1,@returnVal2",parameters);
Guide, example, in ef core
https://dotnetthoughts.net/how-to-execute-storedprocedure-in-ef-core/
With regards, Angelina Jolie