I have a big nasty SQL query to run in asp.net mvc 5, it's supposed to return a non-db-table object, and needs to be parameterized.
viz.
context.Database.SqlQuery<MyObject>("select a, b from table where a = @par")
where I can pass in the value of @par as a parameter
class MyObject {
public a {get;set;}
public b {get;set;}
}
For whatever reason the msdn docs assume that one cannot possibly want to execute any but the simplest of queries... https://msdn.microsoft.com/en-us/data/jj592907.aspx