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

Direct DB Access

There are two methods to send raw database commands. 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.CommandText = "select * from 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. You can also use this method to call stored procedures
DatabaseCommand<MyObject> cmd = _dstore.GetCommand<MyObject>();
MyObject result = cmd.ExecuteQuery("select * from food where name=@name", new { name = "chicken" });