-
Notifications
You must be signed in to change notification settings - Fork 2
BizArk.Data API Reference
Brian Brewder edited this page Nov 13, 2018
·
4 revisions
BizArk.Data contains classes to provide a simple and consistent way to access databases, instead of using an ORM. It provides support for recovering from some types of errors, such as deadlocks.
-
BaDatabase- Abstract base class for working with databases. Encapsulates theDbConnectionobject and manages the lifetime of it, including closing it and recreating it as necessary. Provides some basic methods for accessing the database that are similar to what is found directly on DbCommand, such as ExecuteNonQuery, ExecuteScalar, and ExecuteReader. There are async versions of these methods as well. -
BaTableObject- Derived fromBaObject. Provides a container for working with database tables in an ORM-like fashion. -
BaTransaction- A wrapper around DbTransaction to make working with transactions simpler. Can only be created by callingBaDatabase.BeginTransaction. -
ISupportBaDatabase- Provides a way to get a database instance from the object. Useful for passing a single BaDatabase instance around. -
IBaRepository- Provides a convenient mechanism to hook extension methods up to the BaDatabase class or any class that implements this interface. This encourages the use of stateless repository methods, which is considered a best practice.
NOTE: Each extension is in its own namespace. This allows each one to be added individually.
-
DataExt- Extension methods forDbCommand.
using BizArk.Data.DataExt; -
BaDatabaseExtractExt- Extension methods forBaDatabaseto pull data out in either strongly-typed or dynamic objects.
using BizArk.Data.ExtractExt; -
BaDatabaseSproc- Extension methods forBaDatabaseto support calling stored procedures.
using BizArk.Data.Sproc;
-
SelectCmdBuilder- Builds a complex SELECT SqlCommand object. -
SqlServerDatabase- Derived fromBaDatabaseto support Microsoft Sql Server. -
SqlServerDbFactory- Factory class for buildingSqlServerDatabaseobjects. Intended for use withBaDatabase.Register().
NOTE: Each extension is in its own namespace. This allows each one to be added individually.
-
SqlClientExt- Extension methods for working with objects in the System.Data.SqlClient namespace.
using BizArk.Data.SqlServer.SqlClientExt; -
SqlServerBaTableExt- Extension methods forIBaRepositoryto work withBaTableObject.
using BizArk.Data.SqlServer.BaTableExt; -
SqlServerDatabaseCrudExt- Extension methods forBaDatabaseto supportINSERT/UPDATE/DELETEin Sql Server.
using BizArk.Data.SqlServer.CrudExt;