StoredProcedure 5.0.0

dotnet add package StoredProcedure --version 5.0.0
                    
NuGet\Install-Package StoredProcedure -Version 5.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StoredProcedure" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StoredProcedure" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="StoredProcedure" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add StoredProcedure --version 5.0.0
                    
#r "nuget: StoredProcedure, 5.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package StoredProcedure@5.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StoredProcedure&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=StoredProcedure&version=5.0.0
                    
Install as a Cake Tool

StoredProcedure

It's a Helper Tool to execute a Stored Procedure from .Net Application.

Installation

Use the nuget package manager to install StoredProcedure.

dotnet add package StoredProcedure --version 5.0.0
dotnet add package StoredProcedure --version 3.1.0

Usage

Prepare Data Set as Stored Procedure Accept.

// Here we will use EF context, I wrote this way for simplicity. You should follow EF default DI rules
var context = new Your_App_DbContext
// Tag with Json, If your sp accept json
var obj = new Example { property="value" };
var json = new Json();
json.Add("@Json", obj);
// Tag with Parameter, If your sp accept param
var param = new Param();
param.Add("@Param1", value);
param.Add("@Param2", value2);
// Tag with Output, If your sp accept Out
var output = new Output();
param.Add("@Output", out);

Instruction:

// skip any arguments by using 'default' or 'null'
context.Execute(sp_name,csharp_object_list_for_json,parameter_list,output_list);

// This will return DataTable by default
context.Execute(sp_name,csharp_object_list_for_json,parameter_list);

// will return T_DTO
context.Execute<T_DTO>(sp_name,csharp_object_list_for_json,parameter_list);

Example: 1.1

SQL

EXECUTE [schema].[storeProcedureName]

C#

context.Execute("storedProcedureName", default, default,default);

Example: 1.2

SQL

EXECUTE [schema].[storeProcedureName] @json1,@json2,@json_n

C#

context.Execute("storedProcedureName", json, default,default);

Example: 1.3

SQL

EXECUTE [schema].[storeProcedureName] @json,@param1,@param2,@param_n

C#

context.Execute("storedProcedureName", json, param,default);

Example: 1.4

SQL

EXECUTE [schema].[storeProcedureName] @json,@param,@output

C#

context.Execute("storedProcedureName", json, param,output);

Example: 1.5

SQL

EXECUTE [schema].[storeProcedureName] @param1,@param2,@param_n

C#

context.Execute("storedProcedureName", default, param,default);

Example: 1.6

SQL

EXECUTE [schema].[storeProcedureName] @param1,@param2,@output

C#

context.Execute("storedProcedureName", default, param,output);

Example: 1.7

SQL

EXECUTE [schema].[storeProcedureName] @output1,@output2,@output_n

C#

context.Execute("storedProcedureName", default, default,output);

Example: 2.1

SQL

EXECUTE [schema].[storeProcedureName] @json1,@json2

C#

context.Execute<T_DTO>("storedProcedureName", json, default);

Example: 2.2

SQL

EXECUTE [schema].[storeProcedureName] @json1,@param1

C#

context.Execute<T_DTO>("storedProcedureName", json, param);

Example: 3.1

SQL

EXECUTE [schema].[storeProcedureName] @json1,@json2

C#

context.Execute("storedProcedureName", json, default);

Example: 3.2

SQL

EXECUTE [schema].[storeProcedureName] @json1,@param1

C#

context.Execute("storedProcedureName", json, param);

Description

I will prepare this document later with more specific in details!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
5.0.0 4,957 1/1/2022
3.1.0 866 1/5/2022