I'm trying to run the following command in an ASP.Net Core app.
await _context.Database.ExecuteSqlCommandAsync(
"EXEC AdmissionConsultEndCurrentAndPending @PracticeId @UserId @AdmissionId",
parameters: new[] { AdmissionId, assignments.UserId, assignments.PracticeId });
I've tried the actual command with these combinations as well
EXEC AdmissionConsultEndCurrentAndPending @PracticeId, @UserId, @AdmissionId
AdmissionConsultEndCurrentAndPending, @PracticeId, @UserId, @AdmissionId
The three values that are passed are three integers. In case it matters here is the stored proc
ALTER PROCEDURE [dbo].[AdmissionConsultEndCurrentAndPending]
@AdmissionId INT,
@UserId INT,
@PracticeId INT
AS
BEGIN
SET NOCOUNT ON;
UPDATE
AdmissionConsults
SET
CurrentConsult = 0
WHERE
AdmissionId = @AdmissionId AND
PracticeId = @PracticeId AND
CurrentConsult = 1
END
When I run this though I get the following error: No mapping to a relational type can be found for the CLR type 'Int32[]'.
I'm not sure if this error is referring to the int values I am passing as parameters or perhaps since it's an update query it's trying to return an int value for the number of rows affected. Either way I've yet to get it working.
AdmissionId, assignments.UserId, assignments.PracticeIdare allint? From the error it looks like one of them is and integer arrayint[]