MySqlOptimizer 1.2.0
See the version list below for details.
dotnet add package MySqlOptimizer --version 1.2.0
NuGet\Install-Package MySqlOptimizer -Version 1.2.0
<PackageReference Include="MySqlOptimizer" Version="1.2.0" />
<PackageVersion Include="MySqlOptimizer" Version="1.2.0" />
<PackageReference Include="MySqlOptimizer" />
paket add MySqlOptimizer --version 1.2.0
#r "nuget: MySqlOptimizer, 1.2.0"
#:package MySqlOptimizer@1.2.0
#addin nuget:?package=MySqlOptimizer&version=1.2.0
#tool nuget:?package=MySqlOptimizer&version=1.2.0
Explanation of the Changes Method Signature: The method now takes a storedProcedureName as a string and a Dictionary<string, object> for parameters. This allows you to pass named parameters to the stored procedure.
Command Type: The command type is set to CommandType.StoredProcedure, indicating that the command being executed is a stored procedure.
Adding Parameters: The method iterates over the provided parameters and adds each one to the MySqlCommand object using cmd.Parameters.AddWithValue(). This method automatically handles the parameter types based on the values you provide.
Usage Example Here’s how you might call this method:
string connectionString = "your_connection_string_here"; string storedProcedureName = "your_stored_procedure_name_here";
var parameters = new Dictionary<string, object> { { "@param1", value1 }, { "@param2", value2 }, // Add more parameters as needed };
DataTable result = ExecuteSelect(connectionString, storedProcedureName, parameters); Important Notes Ensure that the parameter names in the dictionary match the names expected by the stored procedure (including the @ symbol). If you have specific data types for parameters, you might want to use MySqlParameter to define them explicitly instead of using AddWithValue(), which infers the type. Always validate and sanitize your inputs to avoid SQL injection and other security issues, especially when dealing with user input.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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 was computed. 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. |
-
net6.0
- MySql.Data (>= 8.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MySqlOptimizer:
| Package | Downloads |
|---|---|
|
MySqlCore
Single-class MySQL helper for .NET with ADO.NET, EF Core, async streaming, pagination, logging, bulk insert/upsert, and transactions. |
GitHub repositories
This package is not used by any popular GitHub repositories.