SPBP.procedure-pattern 1.0.3

dotnet add package SPBP.procedure-pattern --version 1.0.3                
NuGet\Install-Package SPBP.procedure-pattern -Version 1.0.3                
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="SPBP.procedure-pattern" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SPBP.procedure-pattern --version 1.0.3                
#r "nuget: SPBP.procedure-pattern, 1.0.3"                
#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.
// Install SPBP.procedure-pattern as a Cake Addin
#addin nuget:?package=SPBP.procedure-pattern&version=1.0.3

// Install SPBP.procedure-pattern as a Cake Tool
#tool nuget:?package=SPBP.procedure-pattern&version=1.0.3                

Here is explanation of Console application code.

First of all you need to declare a DbAgent variable:

DbAgent agent = new DbAgent(name, connection string.state);

(If agent state isn't true it will throw an exception in procedure execution . )

Then get the all stored procedures existing in that DataBase:

ProcedureFactory fact = SqlManager.GetProceduresFactory(agent);

Select the Procedure:

DataSItem procedure = fact.Procedures[procedurename];

Set values to parameters if procedure needs :

  //fill params  values 
                    foreach (DataParam param in procedure.Params.Values)
                    {
                        if (param.Direction == ParamDirection.Input)
                        {
                            Console.Write(param.Name + : );
                            param.Value = Console.ReadLine();
                        }

                    }

Get output params after execution :

If procedure has output params it will be added to DsItem Output params .

 if (item.HasOutputParam)
                    {
                        foreach (DataParam prm in item.OutputParams.Values)
                        {
                            Console.WriteLine(prm.Name + = + prm.Value);
                        }
                    }

Get marked class collection :

IBag<Item> items;
ExecResult result = procedure.ExecuteDataReaderByRef(agent, out items);

OR

DataSet set = new DataSet();
procedure.ExecDataSet(agent, out set);
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has 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.3 1,525 10/9/2017

Stored Procedure based pattern