Skip to content

1. Getting Started

Vedran Bilopavlović edited this page Dec 21, 2020 · 6 revisions

Getting Started

1) Install the package into your project:

> dotnet add package Norm.net

The package is lightweight and it doesn't have any additional dependencies.

Add using Norm directive in a file where you want to use extensions:

using Norm;

2) Initialize your database connection as you normally do, nothing special in this step.

Connection object is object derived from System.Data.Common.DbConnection base class.

For example, that includes SqlConnection for SQL Server, NpgsqlConnection for PostgreSQL, SQLiteConnection for SQLite, MySqlConnection for MySQL, and so on. All known SQL database providers derive their connection objects from System.Data.Common.DbConnection base class.

Connection object can be created and disposed on spot or injected, the same way as you normally do, no changes required here.

3) Start using connection object extensions:

  • Execute - executes SQL command.
  • Read - executes SQL command and generates an iterator for the results.
  • Multiple - executes SQL commands and returns an object for reading a multiple result sets.

See also

Clone this wiki locally