Skip to content

How To Upgrade to SqlFu2

Mihai Mogosanu edited this page Jul 3, 2013 · 4 revisions

DbAccess and IAccessDb don't exist anymore. SqlFu functionality is provided by extension methods to DbConnection (implemented by SqlFuConnection).

The SqlFuDAo class acts as a registry where you can configure connection string, logging (similarly to the old DbAccess, but the properties are static and only OnCommand, OnException, OnOpen and OnClose are available) and as a connection factory. You can use the GetConnection factory method or you can instantiate the SqlFuConnection class (you can consider SqlFuConnection the new DbAccess).

Important

DbAccess open and closed connection on every query, but SqlFuConnection doesn't close/dispose automatically. While DbAccess acted more as a DAO, SqlFuConnection is a DbConnection and must be treated as such. As a convenience it's automatically opened but you must ALWAYS dispose it.

All features depending on DbAccess(IAccessDb) now depend on DbConnection. The DatabaseTools property now is an extension method db.DatabaseTools().

Clone this wiki locally