0
votes

I'm trying to pass a parameter with a SQL statement using Entity Framework and NpgSql. Here is the code I'm trying to execute:

_dbContext.Database.ExecuteSqlCommand(@"UPDATE dbo.""AuditorQaNotes"" SET ""IsRead""='true' WHERE ""ClientOrderMappingId""= (@mappingId)", new NpgsqlParameter("mappingId", DbType.Int16).Value = mappingId);

I get an error

ERROR: 42703: column \"mappingid\" does not exist

How do I reference the parameter name in the SQL statement?

1

1 Answers

0
votes

You probably want to read the EF Core documentation on passing parameters with raw queries.