AmpScm.RepoDb.MySqlConnector
A hybrid .NET ORM library for MySQL (using MySqlConnector).
Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
RepoDb.MySqlConnector - a hybrid .NET ORM library for MySQL (using MySqlConnector)
RepoDB is an open-source .NET ORM library that bridges the gaps of micro-ORMs and full-ORMs. It helps you simplify the switch-over of when to use the BASIC and ADVANCE operations during the development.
Important Pages
- GitHub Home Page - to learn more about the core library.
- MySQL Guide - getting started with MySQL
- All Documentation - comprehensive guides and references
Community Engagements
- GitHub - for any issues, requests and problems.
- StackOverflow - for any technical questions.
- Gitter Chat - for direct and live Q&A.
Dependencies
- MySqlConnector - the data provider used for MySqlConnector.
- RepoDb - the core library of RepoDB.
License
- Copyright © 2019 - 2024 Michael Camara Pendon
- Copyright © 2025 - now Bert Huijben
Installation
At the Package Manager Console, write the command below.
> Install-Package AmpScm.RepoDb.MySqlConnector
See the MySQL Guide for more information.
Get Started
First, RepoDB must be configured and MySqlConnector support loaded.
using RepoDb;
using MySqlConnector;
GlobalConfiguration.Setup().UseMySqlConnector();
Note: This call must be done once during application startup.
After the bootstrap initialization, any library operation can then be called.
Query
using (var connection = new MySqlConnection(ConnectionString))
{
var customer = connection.Query<Customer>(c => c.Id == 10045);
}
Insert
var customer = new Customer
{
FirstName = "John",
LastName = "Doe",
IsActive = true
};
using (var connection = new MySqlConnection(ConnectionString))
{
var id = connection.Insert<Customer>(customer);
}
Update
using (var connection = new MySqlConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
customer.FirstName = "John";
customer.LastUpdatedUtc = DateTime.UtcNow;
var affectedRows = connection.Update<Customer>(customer);
}
Delete
using (var connection = new MySqlConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
var deletedCount = connection.Delete<Customer>(customer);
}
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.