Net4x.DapperLibrary.Oracle 1.9.9

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

DapperLibrary.SqlServer


# DapperLibrary.Oracle

Oracle provider integration for DapperLibrary. This project provides an Oracle-specific `DapperContext` implementation, a provider factory and Oracle-specific database model and type mappings.

## Purpose

Provide Oracle engine-specific behavior while keeping the DapperLibrary public API consistent across providers. The assembly includes:

- `OracleDapperContext` � a `DapperContext` configured for Oracle (Oracle Managed Data Access).
- `OracleProviderFactory` � configures parameter handling, adapter event forwarding and the `DatabaseModel` factory for Oracle.
- `OracleDatabaseModel`, `OracleDatabaseModelTypes` and `OracleDatabaseEnumTypes` � identifier delimiters, statement terminator, parameter naming and Oracle-specific SQL type strings and enum mappings.

## Key types

- `OracleDapperContext`
  - Derives from `DapperContext` and initializes the context with `OracleProviderFactory` and configuration from `DapperConfigurationManager`.
  - Static helpers `Use`, `Use(IContextCreator)`, `Use(string, string)` and `UseOnce` integrate with `DapperContextFactory` and set Oracle-specific defaults:
    - `DatabaseModel.IdentityInitializer = "GENERATED BY DEFAULT AS IDENTITY"` (Oracle identity/sequence semantics)
    - `DatabaseModel.FormatDatetimeAsString = dateTime => $"TO_DATE('{dateTime:yyyy-MM-dd HH:mm:ss}', 'YYYY-MM-DD HH24:MI:SS')"` for generating Oracle-compatible datetime literals.

- `OracleProviderFactory`
  - Inherits from `ProviderFactoryBase` and wraps `OracleClientFactory.Instance` (Oracle Managed Data Access).
  - Sets `ParameterModel.ParameterPrefix = ":"` and `ParameterModel.AddIndex = true` and installs `PrepareCommandParameters` delegate.
  - Creates `OracleDataAdapter` instances and forwards `RowUpdating`/`RowUpdated` events.

- `OracleDatabaseModel` and related types
  - Identifier delimiters: `"` (double-quote).
  - Statement terminator: `;`.
  - Parameter prefix: `:`.
  - Type mappings reflect Oracle types (for example `RAW(16)` for GUID, `CLOB` for text, `NUMBER`/`NUMBER(19)` for numerics, `BLOB` for binary).

## Usage examples

Create and use an `OracleDapperContext` directly:

```csharp
using var context = new OracleDapperContext();
// use context.Operations / context.Schema / context.SaveDataTable etc.
```

Register a context creator in bootstrap code:

```csharp
OracleDapperContext.Use();

// or bind an explicit connection string and provider name
OracleDapperContext.UseOnce(connectionString, providerName);
```

When creating contexts via the helpers, the database model will be pre-configured with Oracle-friendly defaults for identity/sequence behavior and datetime formatting.

## Multi-targeting & client compatibility

- This project targets .NET Standard 2.1 in the workspace and depends on Oracle Managed Data Access (`Oracle.ManagedDataAccess.Client`) which has specific compatibility constraints. Ensure the consuming application references the appropriate Oracle ManagedDataAccess package compatible with its target framework.
- The DapperLibraries solution includes conditional compilation across projects to allow building provider-specific assemblies for a variety of .NET Framework and modern .NET targets.

## Synchronous vs asynchronous behavior

- `Oracle.ManagedDataAccess` provides asynchronous APIs in supported versions; DapperLibrary exposes both synchronous and `Async` suffixed methods (`GetDataReaderAsync`, `GetDataTableAsync`, `SetDataAsync`, etc.).
- Prefer asynchronous APIs in server or I/O-bound applications. If running on older framework targets or using provider versions without full async support, synchronous methods remain available and are safe to use.

## Events and adapter behavior

- `OracleProviderFactory.CreateDataAdapter` attaches to `RowUpdating`/`RowUpdated` events of `OracleDataAdapter` and forwards them via the provider factory so consumer code can hook into adapter lifecycle when using `SaveDataTable` and similar operations.

## Notes and best practices

- Use `WithConnection` overloads when executing operations against a different named connection for a single call to avoid race conditions around `ConnectionStringToRead`.
- Prefer the `Use` / `UseOnce` helpers to ensure consistent Oracle-specific configuration across created contexts.
- Rely on the schema helpers (`IDapperContext.Schema`) and the library's caching for efficient metadata inspection.

For implementation details, consult the source files under `DbContexts` and `OracleProviderFactory`.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 Net4x.DapperLibrary.Oracle:

Package Downloads
Net4x.DapperLibrary.Docker

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.9 23 12/22/2025
1.6.0.12 228 12/12/2025
1.6.0.11 204 12/12/2025
1.6.0.10 528 12/9/2025
1.6.0.9 189 12/4/2025
1.6.0.8 180 12/4/2025
1.6.0.7 244 11/30/2025
1.6.0.6 169 11/27/2025
1.6.0.5 225 11/22/2025
1.6.0.4 125 11/16/2025
1.6.0.3 164 11/15/2025
1.6.0.2 258 11/14/2025
1.6.0.1 220 11/10/2025
1.6.0 206 11/9/2025
1.5.0.4 196 11/9/2025
1.5.0.3 187 11/5/2025
1.5.0.2 183 11/3/2025
1.5.0.1 187 11/3/2025
1.5.0 139 10/26/2025
1.4.1.6 178 10/24/2025
1.4.1.5 179 10/22/2025