I'm executing some SQL using EF with the .SqlQuery(string sql)
command.
I want to make sure my sql string is completely sanitised, so the logic approach was to use an SqlCommand
object with parameters to build it.
However I don't want to execute it using the SqlCommand, I just want the SqlCommand to spit out a string that I can plug into my EF .SqlQuery(...)
call.
Is there a way of doing this, or another method of ensuring my .SqlQuery
won't result in injection?