Executing SQL Query

Mar 26, 2008 at 10:22 AM
I am just wondering if we could execute a SQL query instead of a stored procedure through Repository classes? I did some research, it seems we need to map the stored procedure name and there is no way to specify the SQL query directly. Can you please correct me if I am wrong?
Also I am sorry if this has been discussed already in this forum.
Mar 27, 2008 at 3:26 AM
The factory is about calling stored procedures. This has always been the recommended best practice from the SQL Server team, and as such we wrote it to make doing the "right" thing easier.

Having said that, if you want to invoke SQL directly, you can create your own factory for the select statement and feed it into the repository by hand. But you'll have to write it yourself.
Mar 27, 2008 at 5:29 AM
Edited Mar 28, 2008 at 12:03 PM
Thanks Chris for your clarification.
Another question - I understand that this is designed based on domain model pattern. There are no datasets/datatables returned, instead repository returns a entity object.
There is a stored procedure that returns multiple result sets based on the input parameter. This may not be assigned to a single object. Is repository factory an ideal solution for handling this scenario?