SimpleStack - MySQL/MariaDB Setup

mariadb Two options are available depending on your requirements.

Using MySQLConnector

Add packages in your project

dotnet add package SimpleStack.Orm
dotnet add package SimpleStack.Orm.MySQLConnector

Sample usage

using SimpleStack.Orm;
using SimpleStack.Orm.MySQLConnector;

var factory = new OrmConnectionFactory(new MySqlConnectorDialectProvider(), "CONNECTION_STRING");

using (var connection = factory.OpenConnection())
{
    // Start Querying Database
    var dogs = await connection.SelectAsync<Dog>(x => x.Age > 20);
}

Using MySQL.Data

Add packages in your project

dotnet add package SimpleStack.Orm
dotnet add package SimpleStack.Orm.MySQL

Sample usage

using SimpleStack.Orm;
using SimpleStack.Orm.MySQL;

var factory = new OrmConnectionFactory(new MySqlDialectProvider(), "server=...");

using (var connection = factory.OpenConnection())
{
    // Start Querying Database
    var dogs = await connection.SelectAsync<Dog>(x => x.Age > 20);
}