RepoDb.MySqlConnector
A hybrid .NET ORM library for MySQL (using MySqlConnector).
Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
RepoDb.MySqlConnector β RepoDB for MySQL (MySqlConnector)
The MySQL provider for RepoDB β a fast, lightweight .NET ORM that lets you use raw SQL and fluent operations side by side on the same connection. Backed by the high-performance MySqlConnector driver.
Important Pages
- GitHub Home β core library and source code.
- Website β full documentation, API reference, and blog.
Community
- GitHub Issues β bug reports and feature requests.
- StackOverflow β technical questions.
- Microsoft Teams β live Q&A.
- X / Twitter β news and updates.
Dependencies
- MySqlConnector β high-performance MySQL data provider.
- RepoDb β the RepoDB core library.
License
Apache-2.0 β Copyright Β© 2020 Michael Camara Pendon
Installation
Install-Package RepoDb.MySqlConnector
Or visit the installation page for more options.
Get Started
Initialize the bootstrapper once at application startup:
RepoDb.MySqlConnectorBootstrap.Initialize();
Then use any RepoDB operation directly on your MySqlConnection:
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);
}
Visit the get-started page for the full MySQL guide.
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.