RetailSolutions.Shared.Database 1.3.1382

dotnet add package RetailSolutions.Shared.Database --version 1.3.1382
                    
NuGet\Install-Package RetailSolutions.Shared.Database -Version 1.3.1382
                    
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="RetailSolutions.Shared.Database" Version="1.3.1382" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RetailSolutions.Shared.Database" Version="1.3.1382" />
                    
Directory.Packages.props
<PackageReference Include="RetailSolutions.Shared.Database" />
                    
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 RetailSolutions.Shared.Database --version 1.3.1382
                    
#r "nuget: RetailSolutions.Shared.Database, 1.3.1382"
                    
#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 RetailSolutions.Shared.Database@1.3.1382
                    
#: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=RetailSolutions.Shared.Database&version=1.3.1382
                    
Install as a Cake Addin
#tool nuget:?package=RetailSolutions.Shared.Database&version=1.3.1382
                    
Install as a Cake Tool

RetailSolutions.Shared.Database

A shared .NET library providing a unified abstraction layer for Oracle and SQL Server database access, built on top of Dapper with connection factory logic and Oracle-specific performance tuning.

NuGet .NET

Features

  • Connection Factory — auto-detects Oracle or SQL Server from the connection string and returns a DbConnection
  • Oracle Performance Tuning — statement cache, bind-by-name, fetch size, and network buffer settings applied at startup
  • SQL Statement Expansion — expands parameterized commands into readable SQL for logging and debugging
  • Dapper Integration — works with DynamicParameters via GetDapperSqlStatement
  • Parameter Binding — replaces @param / :param placeholders with typed literal values

Installation

dotnet add package RetailSolutions.Shared.Database

Available on NuGet.org.

Requirements

  • .NET 10.0 or later

Dependencies

Package Version
Dapper 2.1.66
Microsoft.Data.SqlClient 6.1.3
Oracle.ManagedDataAccess.Core 23.26.0
Microsoft.Extensions.Configuration 10.0.1
Microsoft.Extensions.DependencyInjection 10.0.1
Microsoft.Extensions.Hosting 10.0.1

Usage

DatabaseConnectionFactory

Automatically creates the appropriate connection based on the connection string:

using RetailSolutions.Shared.Database;

// Oracle — detected via "Data Source=" prefix
var oracleConn = DatabaseConnectionFactory.CreateDbConnection(
    "Data Source=localhost:1521/XE;User Id=user;Password=pass;"
);

// SQL Server — detected via "Server=" prefix
var sqlConn = DatabaseConnectionFactory.CreateDbConnection(
    "Server=localhost;Database=MyDb;User Id=user;Password=pass;"
);

Both return DbConnection, keeping the calling code database-agnostic.

Oracle Extensions

Startup Configuration

Call once at application startup to apply Oracle-wide performance settings:

using RetailSolutions.Shared.Database.Extensions;

OracleExtension.ConfigureOracleStartup();

Applied settings:

Setting Value
Statement Cache Size 25
Bind By Name true
Command Timeout 300 s
Fetch Size 1 MB
Trace Directory LogFiles/
Send / Receive Buffer 8192 bytes
SQL Statement Expansion

Expands an OracleCommand into a human-readable SQL string with parameters inlined — useful for logging:

using Oracle.ManagedDataAccess.Client;

var cmd = new OracleCommand("SELECT * FROM users WHERE id = :id");
cmd.Parameters.Add(":id", OracleDbType.Int32).Value = 1;

string sql = cmd.GetSqlStatement();
// SELECT * FROM users WHERE id = 1
Dapper Integration
using Dapper;
using RetailSolutions.Shared.Database.Extensions;

var parameters = new DynamicParameters();
parameters.Add(":id", 1);

string sql = parameters.GetDapperSqlStatement("SELECT * FROM users WHERE id = :id");
// SELECT * FROM users WHERE id = 1

Query Extensions

Replaces @param / :param placeholders with typed literal values:

using RetailSolutions.Shared.Database.Extensions;

var query = "SELECT * FROM users WHERE id = @id AND name = :name";
var parameters = new { id = 1, name = "John" };

string bound = query.BindParameters(parameters);
// SELECT * FROM users WHERE id = 1 AND name = 'John'

Type handling:

Type Output
string Single-quoted, special characters escaped
DateTime 'yyyy/MM/dd'
bool 1 / 0
Numeric Decimal separator normalized to .

Build

dotnet build
dotnet publish   # produces NuGet package

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

License

Copyright © Retail Solutions. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on RetailSolutions.Shared.Database:

Package Downloads
RetailSolutions.Shared.Jobs

Controle de execução de cronjobs

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.1382 184 7/6/2026
1.2.108 96 4/30/2026
1.2.72 907 12/12/2025