Home - nreco/data GitHub Wiki

NReco Data Access Components

NReco.Data is a lightweight, provider-independent library for fast and efficient data access from .NET Core and .NET 4.x applications. It is based on low-level ADO.NET interfaces and provides simple API for SQL statements generation, CRUD operations for both typed models and schema-less structures (dictionary, RecordSet).

NReco.Data can be used either as main application DAL or in addition to another popular data access technologies like EF6, EF Core or Dapper (it can use existing DB connection / transaction instances).

Why use NReco.Data

Despite of the fact that NReco.Data can handle POCO models, it doesn't pretend to be a fully-functional ORM. On the contrary, the power of NReco.Data is in the schema-less, dynamic data access and performance-critical operations:

  • Query structure provides abstract way to compose DB queries and conditions. Query can be easily composed dynamically in run-time.
  • DbCommandBuilder generates parametrized SQL statements, supports concept of dataviews (custom SELECT text accessible like a real table)
  • DbBatchCommandBuilder can produce multiple SELECT/INSERT/UPDATE/DELETE statements in one DbCommand (batch inserts/updates, several selects for multiple result sets).
  • DbDataAdapter provides simple CRUD API that works with models, dictionaries, RecordSet.
  • RecordSet is an efficient replacement for DataTable/DataRow. It is especially useful if query results are dynamic.
  • RecordSetReader may be used with SqlBulkCopy.WriteToServer to copy many in-memory records to SQL Server, pass TVP (table-valued parameters) to SQL Server stored procedure.