FS.Dapper
10.0.10
dotnet add package FS.Dapper --version 10.0.10
NuGet\Install-Package FS.Dapper -Version 10.0.10
<PackageReference Include="FS.Dapper" Version="10.0.10" />
<PackageVersion Include="FS.Dapper" Version="10.0.10" />
<PackageReference Include="FS.Dapper" />
paket add FS.Dapper --version 10.0.10
#r "nuget: FS.Dapper, 10.0.10"
#:package FS.Dapper@10.0.10
#addin nuget:?package=FS.Dapper&version=10.0.10
#tool nuget:?package=FS.Dapper&version=10.0.10
Changelog
[10.0.10]
- Microsoft.AspNetCore.DataProtection → 10.0.10 update
- System.Security.Cryptography.Xml → 10.0.10 update
Usage
First method (MySQL connection example):
This method creates a single reusable connection that is shared for the whole application lifetime and is never closed nor disposed by the service (you own its lifecycle). Register it as a singleton:
string cnString = "<yourConnectionString>";
IDbConnection dbCn = new MySqlConnection(cnString);
services.AddSingleton<IDapperService>(new DapperService(dbCn));
Note: a single shared connection is not thread-safe. Use this mode only for single-threaded scenarios. For concurrent (e.g. web) workloads prefer the second method.
Second method (MS SQL Server connection string example)
This method creates a new connection for every query and closes/disposes it afterwards (the underlying physical connection is reused by the ADO.NET connection pool). This is the recommended mode for concurrent workloads. Register it with a factory so each scope/request gets its own service instance:
services.AddScoped<IDapperService>(sp => new DapperService(DatabaseType.SQLServer, "<yourConnectionString>"));
DatabaseType accepted values:
- MySQL
- SQLServer
- PostgreSQL
Support
If you like this package, please support author offering him a coffee or donate with PayPal
License
MIT License
Copyright (c) 2019 FRΛƝCƎƧCØ ƧØЯRƎƝTIƝØ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Dapper (>= 2.1.79)
- Microsoft.AspNetCore.DataProtection (>= 10.0.10)
- Microsoft.Data.SqlClient (>= 7.0.2)
- MySql.Data (>= 9.7.0)
- MySqlConnector (>= 2.6.1)
- Npgsql (>= 10.0.3)
- System.Security.Cryptography.Xml (>= 10.0.10)
-
net8.0
- Dapper (>= 2.1.79)
- Microsoft.AspNetCore.DataProtection (>= 10.0.10)
- Microsoft.Data.SqlClient (>= 7.0.2)
- MySql.Data (>= 9.7.0)
- MySqlConnector (>= 2.6.1)
- Npgsql (>= 10.0.3)
- System.Security.Cryptography.Xml (>= 10.0.10)
-
net9.0
- Dapper (>= 2.1.79)
- Microsoft.AspNetCore.DataProtection (>= 10.0.10)
- Microsoft.Data.SqlClient (>= 7.0.2)
- MySql.Data (>= 9.7.0)
- MySqlConnector (>= 2.6.1)
- Npgsql (>= 10.0.3)
- System.Security.Cryptography.Xml (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FS.Dapper:
| Package | Downloads |
|---|---|
|
FS.ClientCache
Client cache service for .NET Core |
GitHub repositories
This package is not used by any popular GitHub repositories.