Skip to content

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.

NuGet

BizArk.Data

  • BaDatabase - Abstract base class for working with databases. Encapsulates the DbConnection object 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 from BaObject. 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 calling BaDatabase.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.

BizArk.Data.Extensions

NOTE: Each extension is in its own namespace. This allows each one to be added individually.

  • DataExt - Extension methods for DbCommand.
    using BizArk.Data.DataExt;
  • BaDatabaseExtractExt - Extension methods for BaDatabase to pull data out in either strongly-typed or dynamic objects.
    using BizArk.Data.ExtractExt;
  • BaDatabaseSproc - Extension methods for BaDatabase to support calling stored procedures.
    using BizArk.Data.Sproc;

BizArk.Data.SqlServer

  • SelectCmdBuilder - Builds a complex SELECT SqlCommand object.
  • SqlServerDatabase - Derived from BaDatabase to support Microsoft Sql Server.
  • SqlServerDbFactory - Factory class for building SqlServerDatabase objects. Intended for use with BaDatabase.Register().

BizArk.Data.SqlServer.Extensions

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 for IBaRepository to work with BaTableObject.
    using BizArk.Data.SqlServer.BaTableExt;
  • SqlServerDatabaseCrudExt - Extension methods for BaDatabase to support INSERT/UPDATE/DELETE in Sql Server.
    using BizArk.Data.SqlServer.CrudExt;

Clone this wiki locally