Please Login to Continue

Entity Framework Core Store Procedure with Parameters does not return results (FromSqlRaw)

Question: How do you call Entity Framework Stored Procedure if using (FromSqlRaw) does not return any results?

Answer: If you have used _context.YourClassModel.FromSqlRaw("YourStoreProc {0},{0}",Param1,Param2); and this does not return any results, chances are that the parameters are not getting passed into the Store Procedure at the Back-End (Database). 

[NB] In order to resolve this, use _context.YourClassModel.FromSqlInterpolated($"YourStoreProc{Param1},{Param2}")

Entity Framework Store Procedure in Entity Framework Technology published

Was this page helpful?

Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful..



© 2020 - ErnesTech - Privacy