pilic83.DataProvider
1.0.0
dotnet add package pilic83.DataProvider --version 1.0.0
NuGet\Install-Package pilic83.DataProvider -Version 1.0.0
<PackageReference Include="pilic83.DataProvider" Version="1.0.0" />
paket add pilic83.DataProvider --version 1.0.0
#r "nuget: pilic83.DataProvider, 1.0.0"
// Install pilic83.DataProvider as a Cake Addin #addin nuget:?package=pilic83.DataProvider&version=1.0.0 // Install pilic83.DataProvider as a Cake Tool #tool nuget:?package=pilic83.DataProvider&version=1.0.0
DataProvider
Framework for executing SQL text queries and stored procedures in different databases.<br/> All you have to do is create a data provider class that will derive from the generic class Provider with different type parameters for different databases. For example:<br/> Microsoft SQL Server - Provider<SqlConnection, SqlCommand><br/> SQLite - Provider<SQLiteConnection, SQLiteCommand><br/> MySQL - Provider<MySqlConnection, MySqlCommand><br/> Oracle - Provider<OracleConnection, OracleCommand><br/> PostgreSQL - Provider<NpgsqlConnection, NpgsqlCommand><br/> IBM DB2 - Provider<DB2Connection, DB2Command><br/> Sybase - Provider<AseConnection, AseCommand><br/> Firebird - Provider<FbConnection, FbCommand><br/> SAP HANA - Provider<HanaConnection, HanaCommand><br/> Teradata - Provider<TdConnection, TdCommand><br/> Informix - Provider<IfxConnection, IfxCommand><br/> <br/> //MySQL database example<br/> public class DataProvider : Provider<MySqlConnection, MySqlCommand><br/> {<br/> public DataProvider(string connectionString) : base(connectionString)<br/> {<br/> }<br/> //Your methodes for executing stored procedures and text SQL queries<br/> //If your stored procedure or text SQL querie doesn't have parameters<br/> //you can just call Repository.ExecuteAsQuery("SomeStoredProcedure") and you'll get DataTable as result <br/> //or Repository.ExecuteAsQuery< Model >("SomeStoredProcedure") and you'll get List<Model> where Model you have define as record with all stufs which it contains to map database response<br/> //public record Model(int id, string name, DateTime date);<br/> //or you can call Repository.ExecuteAsQuery< string >("SomeStoredProcedure") or Repository.ExecuteAsQuery< int >("SomeStoredProcedure") or something else and get List<string> or List<int> depending on what you need<br/> //and finaly you can call Repository.ExecuteAsCommand("SomeStoredProcedure") and get true or false depending on whether the execution was successful<br/> <br/> //If your stored procedure or text SQL querie contains parameters, you have map parameters in List of Tuples<string, objects><br/> //where is string Item1 - parameter name, and object Item2 - parameter value<br/> //Rest is same as previous<br/> //Repository.ExecuteAsQuery< string >("SELECT * FROM Students WHERE Students.Year > @year", new List<(string, object)>(){("@year", someintvalue)})<br/> //or<br/> //Repository.ExecuteAsCommand("UpdateStudents", new List<(string, object)>(){("@year", someintvalue), ("@name", somestring)})<br/> }<br/>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 205 | 3/26/2023 |