Dev Tools · 3h ago
Build a Generic Read-Only Table API with Dapper in 80 Lines
A developer shares a lightweight C# template for creating a generic read-only API over PostgreSQL tables using Dapper and Npgsql. The approach avoids Entity Framework and code generation, requiring only 80 lines of code. It enforces security by whitelisting allowed tables and columns, with pagination and snake_case-to-camelCase conversion.
Meridian48 take
Practical for quick internal tools, but the security boundary relies on developer discipline—a misconfigured whitelist could expose sensitive data.
dapperpostgresql-api