DbToJson 1.0.3

Additional Details

Does not include useful methods

There is a newer version of this package available.
See the version list below for details.
dotnet add package DbToJson --version 1.0.3
NuGet\Install-Package DbToJson -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="DbToJson" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DbToJson --version 1.0.3
#r "nuget: DbToJson, 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 DbToJson as a Cake Addin
#addin nuget:?package=DbToJson&version=1.0.3

// Install DbToJson as a Cake Tool
#tool nuget:?package=DbToJson&version=1.0.3

Getting Started

Once installed, DbToJson needs just few steps to work.

  1. Make sure DLL exist in references
  2. Add section DbToJson to the project's configuration file, like below:
<configuration>
    <configSections>
        <section name="DbToJson" type="System.Configuration.AppSettingsSection"/>
    </configSections>
    <connectionStrings>
        <add name="Test" connectionString="..." providerName="System.Data.SqlClient" />
    </connectionStrings>
    <DbToJson>
        <add key="ConnectionString" value="Test" />
    </DbToJson>
</configuration>

Query

It builds up the interaction with database and return the expected result. The constructor awaits these two parameters:

  • Text, equals to the stored procedure's name or SQL text of the query
  • Service, that is the response's translation service to use
  • isSp, by default to true, can be overrided when you want to execute SQL text
Query query = new Query("GetUsers", new JsonService());

Core

It is the singleton class that communicate with database. Expose the following methods:

  • GetObject
  • GetObjectList

N.B.: When you want an output in JSON format, use the type dynamic instead of string.

IService

Interface reusable to develop your own response's translation service to use with DbToJson. It expose the following methods:

  • TranslateObject, when you have only one result in response
  • TranslateObjectList, to translate lists of results
  • TranslateObjectCommand, needed when expected return paramaters from the stored procedure

Actually, DbToJson has included following services:

  • JsonService, to convert in JSON format
  • ObjectService, to convert data in a specific type
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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
1.1.1 569 11/11/2019
1.1.0 563 11/7/2019
1.0.3 657 7/12/2019

Initial release.