View on GitHub

SauceDB

.net ORM with multipe database engine support.

Download this project as a .zip file Download this project as a tar.gz file

Stored Procedures

There are two methods to call stored procedures. One is very close to ADO.net while the other adds some helpers on top of it.

Method 1

Using this method you have complete control over the Database command, and whatever you generate will be passed directly to the database.
IDbCommand cmd = _dstore.Connection.GetCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "foo";
cmd.Parameters.Add(_dstore.Connection.GetParameter("@parm1", "Hello"));

//if you are using the extension lib you can do this..
cmd.AddParameter("@parm2", "hello");

//to execute it you simply do (as appropriate)
_dstore.ExecuteCommand(cmd);
_dstore.ExecuteCommandLoadList<MyObject>(cmd);
_dstore.ExecuteCommandLoadObject<MyObject>(cmd);

Method 2

Using this method parameters and such are generated on your behalf.
DatabaseCommand<MyObject> cmd = _dstore.GetCommand<MyObject>();

//as appropriate
List<MyObject> result = cmd.ExecuteStoredProcedure("foo", new { name = "chicken" });
MyObject result = cmd.ExecuteStoredProcedureGetObject("foo", new { name = "chicken" });