-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added readme file and updated props to include in build.
- Loading branch information
Showing
2 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Syrx.MySql | ||
|
||
This project provides Syrx support for MySql. The overall experience of using [Syrx](https://github.com/Syrx/Syrx) remains the same. The only difference should be during dependency registration. | ||
|
||
|
||
## Installation | ||
> [!TIP] | ||
> We recommend installing the Extensions package which includes extension methods for easier configuration. | ||
|Source|Command| | ||
|--|--| | ||
|.NET CLI|```dotnet add package Syrx.MySql.Extensions``` | ||
|Package Manager|```Install-Package Syrx.MySql.Extensions``` | ||
|Package Reference|```<PackageReference Include="Syrx.MySql.Extensions" Version="2.4.0" />```| | ||
|Paket CLI|```paket add Syrx.MySql.Extensions --version 2.4.0```| | ||
|
||
However, if you don't need the configuration options, you can install the standalone Oracle package. | ||
|
||
Standalone installation of the package is via [nuget](https://www.nuget.org/packages/Syrx.MySql/). However we recommend installing the extensions package. | ||
|
||
|Source|Command| | ||
|--|--| | ||
|.NET CLI|```dotnet add package Syrx.MySql``` | ||
|Package Manager|```Install-Package Syrx.MySql``` | ||
|Package Reference|```<PackageReference Include="Syrx.MySql" Version="2.4.0" />```| | ||
|Paket CLI|```paket add Syrx.MySql --version 2.4.0```| | ||
|
||
|
||
## Extensions | ||
The `Syrx.MySql.Extensions` package provides dependency injection support via extension methods. | ||
|
||
```csharp | ||
// add a using statement to the top of the file or in a global usings file. | ||
using Syrx.Commanders.Databases.Connectors.MySql.Extensions; | ||
|
||
public static IServiceCollection Install(this IServiceCollection services) | ||
{ | ||
return services | ||
.UseSyrx(factory => factory // inject Syrx | ||
.UseMySql(builder => builder // using the MySql implementation | ||
.AddConnectionString(/*...*/) // add/resolve connection string details | ||
.AddCommand(/*...*/) // add/resolve commands for each type/method | ||
) | ||
); | ||
} | ||
``` | ||
|
||
## Credits | ||
Syrx is inspired by and build on top of [Dapper](https://github.com/DapperLib/Dapper). | ||
MySql support is provided by [MySqlConnector](https://github.com/mysql-net/MySqlConnector). |