Rop.AbsDatabase10 1.0.2

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

Rop.AbsDatabase10

Abstract database layer providing base functionality for database operations with Unit of Work pattern, transaction management, and result-oriented error handling.

Main Features

  • Abstract Base Class: Foundation for database implementations (SQL Server, PostgreSQL, etc.)
  • Unit of Work Pattern: Execute multiple operations in a single transaction
  • Connection Management: Automatic connection lifecycle handling
  • Result-Oriented Error Handling: Integration with Rop.Results9 for robust error handling
  • Transaction Support: Comprehensive transaction management with automatic rollback
  • Extension Methods: Helper methods for common database operations
  • Connection String Parsing: Automatic extraction of server and database name
  • Full Async/await Support: All operations have asynchronous versions
  • Compatible with C# 13 and .NET 9

Overview

Rop.AbsDatabase10 is the abstract foundation layer that provides:

  • Base infrastructure for database operations
  • Unit of Work pattern implementation
  • Connection and transaction management
  • Integration point for Dapper and Dapper.Contrib extensions

This library is extended by concrete implementations like Rop.SqlDatabase10.

Installation

This is an internal library, typically referenced by other projects:

dotnet add reference ../Rop.AbsDatabase10/Rop.AbsDatabase10.csproj

Dependencies

  • Rop.Dapper.ContribEx10: Dapper extensions for CRUD operations
  • Dapper.Contrib: CRUD helpers for Dapper
  • Rop.Results9: Result-oriented error handling library

Quick Start

Implementing a Concrete Database

using Rop.Database;

public class MyDatabase : AbsDatabase
{
    public MyDatabase(string connectionString) : base(connectionString) { }

    // Implement abstract factory method
    public override DbConnection FactoryConnection()
    {
        return new SqlConnection(Strconn);
    }
}

Using Unit of Work

var database = new MyDatabase(connectionString);

// Execute in transaction - return value
var result = database.UnitOfWork<User>(conn =>
{
    var user = conn.Get<User>(userId);
    user.LastLogin = DateTime.Now;
    conn.Update(user);
    return user;
});

// Execute in transaction - void
var voidResult = database.UnitOfWorkVoid(conn =>
{
    conn.Delete<User>(userId);
    conn.Insert(new User { Name = "New User" });
});

Async Unit of Work

// Async with return value
var user = await database.UnitOfWorkAsync<User>(async conn =>
{
    var user = await conn.GetAsync<User>(userId);
    user.LastLogin = DateTime.Now;
    await conn.UpdateAsync(user);
    return user;
});

Result-Oriented Error Handling

// Check for success
var result = database.Get<User>(userId);
if (result.IsSuccess)
{
    var user = result.Value;
    Console.WriteLine($"User: {user.Name}");
}
else
{
    Console.WriteLine($"Error: {result.Error.Message}");
}

// Throw on failure
var user = database.Get<User>(userId)
    .ThrowIfFailed()
    .Value;

License

This project is licensed under GPL-3.0-or-later.

See LICENSE file for details.

  • Rop.SqlDatabase10: SQL Server concrete implementation
  • Rop.Dapper.ContribEx10: Dapper extensions
  • Rop.Results9: Result-oriented error handling

Documentation

  • [Rop.Dapper.ContribEx10 Documentation] - Dapper extensions and helpers
  • [Rop.AbsDatabase10 Documentation] - Abstract database layer and Unit of Work ✅ NUEVO
  • [Rop.SqlDatabase10 Documentation] - Repository patterns and Change Tracking

Copyright © 2025 Ramon Ordiales Plaza - Licensed under GPL-3.0-or-later

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

Showing the top 1 NuGet packages that depend on Rop.AbsDatabase10:

Package Downloads
Rop.SqlDatabase10

SQL Server implementation for Rop.Database10 with Change Tracking, Repository patterns, Cache, and advanced features

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 289 10/24/2025
1.0.1 227 10/17/2025