Ddap.Core 1.0.2.3

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

<div align="center"> <img src="icons/icon.svg" alt="DDAP Icon" width="128" height="128">

πŸŽ›οΈ DDAP - Developer in Control

Dynamic Data API Provider. You control everything. We handle the boilerplate.

NuGet Version NuGet Downloads GitHub Release License

Build Status CodeQL Docs GitHub Stars GitHub Forks

⚠️ Migrating from v0.x? Package names have changed. See Known Issues for migration guide. </div>

⚑ What is DDAP?

DDAP automatically generates REST, GraphQL, and gRPC APIs from your database schemaβ€”but without forcing any decisions on you.

Unlike other frameworks that lock you into specific libraries, databases, or patterns, DDAP provides infrastructure only. You choose:

  • πŸ—„οΈ Your database (SQL Server, MySQL, PostgreSQL, SQLite, or custom)
  • πŸ”§ Your ORM (Dapper or Entity Framework)
  • 🎨 Your serializer (System.Text.Json, Newtonsoft.Json, or any)
  • 🌐 Your API style (REST, GraphQL, gRPC, or all three)

DDAP discovers your schema, generates base types, and gets out of your way.


🎯 Developer in Control

What DDAP Provides What You Control
βœ… Entity discovery from database 🎯 Database type (SQL Server, MySQL, etc.)
βœ… Metadata mapping (tables, columns, keys) 🎯 ORM choice (Dapper or Entity Framework)
βœ… Base API types (controllers, queries, services) 🎯 Serialization library (any JSON library)
βœ… Auto-Reload infrastructure 🎯 Auto-Reload configuration (when, how)
βœ… Hooks and lifecycle callbacks 🎯 GraphQL configuration (complete control)
βœ… Partial classes for extension 🎯 REST configuration (formatters, routing)
🎯 gRPC configuration (services, options)
🎯 Everything else!

❌ Other Frameworks vs βœ… DDAP

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  🚫 Opinionated Frameworks          β”‚
β”‚  ❌ Force Newtonsoft.Json           β”‚
β”‚  ❌ Hardcode XML/YAML formatters    β”‚
β”‚  ❌ Database-specific packages      β”‚
β”‚  ❌ Hidden configurations           β”‚
β”‚  ❌ Lock you into patterns          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  βœ… DDAP - Developer in Control     β”‚
β”‚  βœ… You choose serializer           β”‚
β”‚  βœ… You configure formatters        β”‚
β”‚  βœ… Single Dapper, ANY database     β”‚
β”‚  βœ… Everything explicit             β”‚
β”‚  βœ… You own the architecture        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ€” Why DDAP?

The Problem: Framework Lock-In

Most API frameworks promise to speed up development, but they lock you into their choices:

  • πŸ”’ Fixed Dependencies: Forced to use specific libraries (Newtonsoft.Json, Entity Framework, etc.)
  • πŸ”’ Hidden Magic: Behavior you can't see, debug, or modify
  • πŸ”’ Database Coupling: Tight integration with specific database providers
  • πŸ”’ Migration Pain: When you need to change, you rewrite everything

Example: Your framework uses Newtonsoft.Json internally. You want to switch to System.Text.Json for performance. You can'tβ€”it's hardcoded. You're stuck.

The DDAP Solution: Infrastructure, Not Opinion

DDAP takes a radically different approach. We provide infrastructure without forcing any decisions:

🎯 Developer Empowerment

You make every technical decision. Want to use Dapper? Use Dapper. Want Entity Framework? Use Entity Framework. Want to switch tomorrow? Switch. DDAP adapts to your choicesβ€”you never adapt to DDAP.

// YOUR choice of database - any IDbConnection works
builder.Services.AddDdap()
    .AddDapper(() => new MySqlConnection(...))  // Or SqlConnection, NpgsqlConnection, etc.
    .AddRest();

// Later, switch to Entity Framework - no problem
builder.Services.AddDdap()
    .AddEntityFramework<MyDbContext>()
    .AddRest();
πŸͺΆ Minimal Dependencies

DDAP Core has ZERO opinionated dependencies. We don't bundle:

  • ❌ No JSON library (you choose: System.Text.Json, Newtonsoft.Json, or custom)
  • ❌ No database drivers (you add only what you need)
  • ❌ No specific ORM version (you control your dependency graph)
  • ❌ No hidden middleware (you see and control everything)

Result: Your application stays lean. You only pay for what you use.

πŸ›‘οΈ Resilient Abstraction

DDAP abstracts the right things:

  • βœ… Schema Discovery: We handle reading database metadata
  • βœ… Code Generation: We generate boilerplate (controllers, queries, types)
  • βœ… API Plumbing: We provide base classes you can extend
  • ❌ NOT Business Logic: Your domain stays yours
  • ❌ NOT Configuration: You configure everything explicitly

If DDAP disappeared tomorrow, your application would still workβ€”you own the architecture.

πŸ”„ Zero-Downtime Evolution

Auto-Reload System detects schema changes and reloads without restarting:

options.AutoReload = new AutoReloadOptions
{
    Enabled = true,
    IdleTimeout = TimeSpan.FromMinutes(5),
    Strategy = ReloadStrategy.InvalidateAndRebuild,  // You choose
    Behavior = ReloadBehavior.ServeOldSchema         // You choose
};

Deploy database changes. DDAP detects them. API updates automatically. Zero downtime.

When to Use DDAP

βœ… Use DDAP when you want:

  • Full control over your technology stack
  • To avoid framework lock-in
  • Minimal dependencies in your application
  • Explicit, debuggable configuration
  • Freedom to evolve your architecture
  • Database-first or schema-first development
  • Multiple API protocols (REST + GraphQL + gRPC)

❌ Don't use DDAP if:

  • You prefer frameworks that make all decisions for you
  • You're building a non-database-backed API
  • You want an all-in-one solution with batteries included
  • You're okay with framework lock-in

The DDAP Philosophy

"Framework features should be opt-in, not opt-out. Decisions should be explicit, not implicit. The developer should control the framework, not the other way around."

DDAP is infrastructure you control, not a framework that controls you.


πŸš€ Quick Start

1. Install packages

dotnet add package Ddap.Core
dotnet add package Ddap.Data.Dapper  # OR Ddap.Data.EntityFramework
dotnet add package Ddap.GraphQL      # Optional
dotnet add package Ddap.Rest         # Optional
dotnet add package Ddap.Grpc         # Optional

2. Configure (Dapper example)

using Microsoft.Data.SqlClient;

var builder = WebApplication.CreateBuilder(args);

// YOU choose the database connection
builder.Services.AddDdap()
    .AddDapper(() => new SqlConnection(
        builder.Configuration.GetConnectionString("DefaultConnection")
    ))
    .AddRest()
    .AddGraphQL(graphql =>
    {
        // YOU configure HotChocolate
        graphql
            .AddFiltering()
            .AddSorting()
            .AddProjections();
    });

var app = builder.Build();
app.MapControllers();
app.MapGraphQL();
app.Run();

3. Done! πŸŽ‰

  • REST: GET /api/entity
  • GraphQL: POST /graphql { entities { name } }

✨ Features

πŸ—„οΈ Database Agnostic

  • Dapper: Works with ANY IDbConnection (SQL Server, MySQL, PostgreSQL, SQLite, Oracle, etc.)
  • Entity Framework: Use your existing DbContext

🌐 Multi-Protocol APIs

  • REST: Standard HTTP/JSON endpoints with full controller customization
  • GraphQL: Powered by HotChocolate, fully configurable
  • gRPC: High-performance RPC, configurable services

πŸ”„ Auto-Reload System

Automatically reloads database schema after idle periods:

  • βœ… 3 Strategies: InvalidateAndRebuild, HotReloadIncremental, RestartExecutor
  • βœ… 3 Behaviors: ServeOldSchema, BlockRequests, QueueRequests
  • βœ… 3 Detection Methods: AlwaysReload, CheckHash, CheckTimestamps
  • βœ… Lifecycle Hooks: OnBeforeReloadAsync, OnAfterReloadAsync
options.AutoReload = new AutoReloadOptions
{
    Enabled = true,
    IdleTimeout = TimeSpan.FromMinutes(5),
    Strategy = ReloadStrategy.InvalidateAndRebuild,
    Behavior = ReloadBehavior.ServeOldSchema,
    Detection = ChangeDetection.CheckHash
};

πŸŽ›οΈ Zero Opinions

  • No forced dependencies
  • No hidden configurations
  • No magic behavior
  • You configure everything

πŸ”§ Fully Extensible

// Extend via partial classes
namespace Ddap.Rest;

public partial class EntityController
{
    [HttpGet("custom")]
    public IActionResult Custom() => Ok("Your endpoint");
}

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Your Application                 β”‚
β”‚  (Controllers, Services, Business Logic)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        DDAP Core Infrastructure           β”‚
β”‚  βœ… Entity Discovery                      β”‚
β”‚  βœ… Metadata Mapping                      β”‚
β”‚  βœ… Base Type Generation                  β”‚
β”‚  βœ… Auto-Reload Management                β”‚
β”‚  βœ… Lifecycle Hooks                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Your Configuration Choices          β”‚
β”‚  🎯 Database: SQL Server / MySQL / etc.  β”‚
β”‚  🎯 ORM: Dapper / Entity Framework        β”‚
β”‚  🎯 Serializer: System.Text.Json / etc.  β”‚
β”‚  🎯 APIs: REST / GraphQL / gRPC           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Packages

Package Status Legend

  • βœ… Stable: Production-ready, fully tested
  • ⚠️ Known Issues: Functional with documented issues

Core Infrastructure

Package Description Status
Ddap.Core Core abstractions, infrastructure, and base types βœ… Stable

Data Access Providers

Package Description Status
Dapper-Based
Ddap.Data.Dapper Dapper provider (works with ANY IDbConnection) βœ… Stable
Entity Framework-Based
Ddap.Data.EntityFramework Entity Framework Core provider βœ… Stable

Note: Dapper is database-agnostic. Add your database driver (e.g., Microsoft.Data.SqlClient, MySqlConnector, Npgsql) alongside Ddap.Data.Dapper.

API Protocol Providers

Package Description Status
Ddap.Rest REST API endpoints with full controller customization βœ… Stable
Ddap.GraphQL GraphQL API powered by HotChocolate βœ… Stable
Ddap.Grpc High-performance gRPC services βœ… Stable

Additional Features

Package Description Status
Ddap.Auth JWT authentication and authorization βœ… Stable
Ddap.Subscriptions Real-time subscriptions (WebSockets, SignalR) βœ… Stable
Ddap.Aspire .NET Aspire orchestration and observability βœ… Stable

Development Tools

Package Description Status
Ddap.CodeGen Source generators for boilerplate code βœ… Stable

Client Libraries

Package Description Status
Ddap.Client.Core Core client abstractions and base types βœ… Stable
Ddap.Client.Rest Type-safe REST client βœ… Stable
Ddap.Client.GraphQL GraphQL client with query building βœ… Stable
Ddap.Client.Grpc High-performance gRPC client βœ… Stable

πŸ“š Documentation


🀝 Contributing

Contributions welcome! See CONTRIBUTING.md


πŸ“„ License

MIT License - see LICENSE


⭐ Star History

If DDAP helps you, please star the repo! 🌟


Built with ❀️ by developers who believe in control, not constraints.

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 (10)

Showing the top 5 NuGet packages that depend on Ddap.Core:

Package Downloads
Ddap.GraphQL

GraphQL API provider for DDAP powered by HotChocolate with automatic schema generation, queries, mutations, and introspection support.

Ddap.Subscriptions

Real-time subscription support for DDAP using SignalR and GraphQL subscriptions for live data updates.

Ddap.Grpc

gRPC API provider for DDAP with high-performance binary protocol support, HTTP/2, streaming, and Protocol Buffers.

Ddap.Auth

Authentication and authorization support for DDAP with JWT Bearer token integration and ASP.NET Core authorization policies.

Ddap.Rest

REST API provider for DDAP with automatic endpoint generation, content negotiation (JSON/XML), and standard HTTP verb support.

GitHub repositories

This package is not used by any popular GitHub repositories.