CoreOracleDatabase 2025.7.8

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

CoreOracleDatabase

Biblioteca que proporciona una implementación robusta para la conexión y operaciones con bases de datos Oracle en aplicaciones .NET.

Características

  • Conexión segura a Oracle Database
  • Manejo de transacciones
  • Ejecución de consultas y procedimientos almacenados
  • Soporte para parámetros
  • Manejo de errores robusto
  • Soporte para operaciones asíncronas
  • Manejo de conexiones temporales
  • Integración con inyección de dependencias

Instalación

El componente se puede instalar como un paquete NuGet:

dotnet add package DeveloperKit.CoreOracleDatabase

Requisitos

  • Oracle Database 11g o superior
  • Oracle Data Provider for .NET (ODP.NET)
  • .NET Framework 4.8 o superior
  • Visual Studio 2019 o superior

Uso Básico

Configuración Inicial

// Configurar la conexión
services.AddScoped<IOracleRepository, OracleRepository>(provider =>
{
    var connectionString = Configuration.GetConnectionString("OracleConnection");
    return new OracleRepository(connectionString);
});

Ejemplo de Uso

// Inyección del repositorio
private readonly IOracleRepository _oracleRepository;

public MyService(IOracleRepository oracleRepository)
{
    _oracleRepository = oracleRepository;
}

// Ejecutar consulta
public async Task<DataTable> GetCustomers()
{
    var query = "SELECT * FROM CUSTOMERS WHERE ACTIVE = :active";
    
    return await _oracleRepository.ExecuteQueryAsTableAsync(query, parameters =>
    {
        parameters.Add("active", OracleDbType.Int32, 1, ParameterDirection.Input);
    });
}

// Ejecutar procedimiento almacenado
public async Task ExecuteStoredProcedure()
{
    var spName = "PKG_CUSTOMERS.GET_CUSTOMER";
    
    await _oracleRepository.ExecuteStoredProcedureAsync(spName, parameters =>
    {
        parameters.Add("p_customer_id", OracleDbType.Int32, 123, ParameterDirection.Input);
        parameters.Add("p_result", OracleDbType.Int32, ParameterDirection.Output);
    });
}

Manejo de Transacciones

public async Task ExecuteWithTransaction()
{
    try
    {
        // Iniciar transacción
        _oracleRepository.BeginTransaction();
        
        // Ejecutar operaciones
        await _oracleRepository.ExecuteQueryAsync("INSERT INTO CUSTOMERS (...) VALUES (...)"));
        await _oracleRepository.ExecuteQueryAsync("UPDATE CUSTOMERS SET (...) WHERE (...)"));
        
        // Confirmar transacción
        _oracleRepository.CommitTransaction();
    }
    catch (Exception ex)
    {
        // Revertir transacción en caso de error
        _oracleRepository.RollbackTransaction();
        throw;
    }
}

Manejo de Parámetros

// Parámetros de entrada
parameters.Add("p_input", OracleDbType.Varchar2, "valor", ParameterDirection.Input);

// Parámetros de salida
parameters.Add("p_output", OracleDbType.Varchar2, ParameterDirection.Output);

// Parámetros de entrada/salida
parameters.Add("p_inout", OracleDbType.Int32, 1, ParameterDirection.InputOutput);

Mejores Prácticas

  1. Siempre usar parámetros en las consultas para evitar inyección SQL
  2. Manejar transacciones para operaciones que afectan múltiples tablas
  3. Usar conexiones asíncronas para operaciones largas
  4. Implementar manejo de errores robusto
  5. Usar procedimientos almacenados cuando sea posible
  6. Implementar timeout adecuado para consultas
  7. Usar pool de conexiones para mejor rendimiento

Soporte

Para reportar errores o solicitar características, por favor abre un issue en el repositorio de GitHub.

Licencia

Este proyecto está bajo la licencia MIT. Ver el archivo LICENSE para más detalles.

Autor

David Vázquez Palestino

  • Desarrollador de software con experiencia en .NET y Oracle Database
  • Creador y mantenedor de CoreOracleDatabase

Agradecimientos

  • A la comunidad de desarrolladores .NET por su apoyo y contribuciones
  • A todos los contribuyentes que han ayudado a mejorar este proyecto
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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 is compatible.  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 is compatible.  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
2025.7.24 423 7/24/2025
2025.7.21 475 7/22/2025
2025.7.20 184 7/20/2025
2025.7.19 179 7/20/2025
2025.7.13 120 7/14/2025
2025.7.9 118 7/8/2025
2025.7.8 117 7/8/2025
2025.7.3 94 7/4/2025
2025.7.2 97 7/4/2025
2025.6.11 266 6/11/2025
2025.5.23 82 5/23/2025
2025.5.20 134 5/20/2025
2025.5.8 146 5/8/2025
2025.5.4 135 5/4/2025
2025.5.1 136 5/1/2025
2025.4.30 130 4/30/2025
2025.4.4 87 4/5/2025
2025.3.22 147 3/22/2025
2025.3.8 133 3/9/2025
2025.2.1 102 2/1/2025
2025.1.12 87 1/12/2025
2024.12.4 106 12/4/2024
2024.11.30 99 12/1/2024
2024.11.12 110 11/12/2024
2024.10.10 102 10/10/2024
2024.10.9 112 10/9/2024
2024.10.7 108 10/4/2024
2024.10.6 100 10/4/2024
2024.9.8 99 9/9/2024
2024.9.5 104 9/6/2024
2024.8.13 123 8/14/2024
2024.8.1 115 8/1/2024
2024.7.24 94 7/24/2024
2024.7.13 107 7/14/2024
2024.6.9 106 6/10/2024
2024.5.13 103 5/14/2024
2024.4.22 125 4/23/2024
2024.4.13 128 4/13/2024
2024.4.12 116 4/13/2024
2024.1.2 202 1/2/2024
2023.12.26 127 12/26/2023
2023.11.30 149 12/11/2023
2023.11.28 146 11/27/2023