Strong type mapping and multiple result sets using stored procedures
Closed this issue · 3 comments
This isn't an issue but rather a question as I'm trying to compare SqlFu against the ORM we're currently using and in the way we're using it.
All code in SqlFu related to stored procedures seems to return StoredProcedureResult
instance which is basically a dictionary with untyped (object
) values. Does SqlFo support entity mapping so we could say i.e.
db.ExecuteStoredProcedure<User>("sprocName", new { CountryId = "UK" });
How about mutiple resultsets?
The thing is that I like to issue a single DB request to a stored procedure that does multiple queries and then returns something. For instance a very simple example is creating some item. I usually call a stored procedure that creates the item and then also returns it so app can immediately consume data of the actual record including those props that are DB generated...
How's all this supported in SqlFu?
It isn't. I'm not using SPs very often, hence the limited support for SP.
How about if I just used db.Query<Entity>("exec spName @Param1, @Param2,...", new { Param1 = 1, Param2 = 2});
? Would this work? Or do you do any SQL squery parsing that would fail this call?
Try it and see