Database Connection
Trinity
uses Dapper for manging database connections, and SQLKata for handling queries,
therefore Trinity
is Database agnostic, you can use it with any database provider supported by Dapper
and SQLKata
.
Configurations
To configure Trinity
with your database connection provider , add the connection factory :-
var conn = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddTrinity(configs =>
{
configs.ConnectionFactory = () => new MySqlConnection(conn);
});