I am using VS 2019 and I have a simple Web API method to execute a stored procedure that returns one string. I am using Entity Framework Core version 3.1.31.
When I am trying to call the stored procedure in my Web API method by using
context.Database.FromSqlRawAsync
I get an error
DatabaseFacade does not contain a definition for FromSqlRaw...
However if I use ExecuteSqlRaw
, it accepts it and does not throw any error.
Any suggestion on how to resolve this?
I have tried installing Microsoft.EntityFrameworkCore.Relational
package version 3.1.31 from nuget package manager. I am also using using Microsoft.EntityFrameworkCore
statement in the Web API controller.
What else do I need to do?