{"id":34550480,"url":"https://github.com/jerrettdavis/jd.efcpt.build","last_synced_at":"2026-04-28T05:01:55.743Z","repository":{"id":329034779,"uuid":"1117273107","full_name":"JerrettDavis/JD.Efcpt.Build","owner":"JerrettDavis","description":"Database-first EF Core model generation automated via MSBuild.","archived":false,"fork":false,"pushed_at":"2026-04-20T16:08:40.000Z","size":6307,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T17:42:24.254Z","etag":null,"topics":["automation","ci-cd","code-generation","dacpac","database-first","developer-tools","dotnet","dotnet-build","ef-core","ef-core-power-tools","entity-framework-core","msbuild","msbuild-target","msbuild-task","msbuild-tasks","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://jerrettdavis.github.io/JD.Efcpt.Build/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JerrettDavis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-16T04:42:36.000Z","updated_at":"2026-04-20T15:55:51.000Z","dependencies_parsed_at":"2026-02-10T05:09:26.561Z","dependency_job_id":null,"html_url":"https://github.com/JerrettDavis/JD.Efcpt.Build","commit_stats":null,"previous_names":["jerrettdavis/jd.efcpt.build"],"tags_count":77,"template":false,"template_full_name":null,"purl":"pkg:github/JerrettDavis/JD.Efcpt.Build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerrettDavis%2FJD.Efcpt.Build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerrettDavis%2FJD.Efcpt.Build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerrettDavis%2FJD.Efcpt.Build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerrettDavis%2FJD.Efcpt.Build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JerrettDavis","download_url":"https://codeload.github.com/JerrettDavis/JD.Efcpt.Build/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerrettDavis%2FJD.Efcpt.Build/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32367021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","ci-cd","code-generation","dacpac","database-first","developer-tools","dotnet","dotnet-build","ef-core","ef-core-power-tools","entity-framework-core","msbuild","msbuild-target","msbuild-task","msbuild-tasks","reverse-engineering"],"created_at":"2025-12-24T07:58:43.728Z","updated_at":"2026-04-28T05:01:55.731Z","avatar_url":"https://github.com/JerrettDavis.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JD.Efcpt.Build\n\n[![NuGet](https://img.shields.io/nuget/v/JD.Efcpt.Build.svg)](https://www.nuget.org/packages/JD.Efcpt.Build/)\n[![License](https://img.shields.io/github/license/jerrettdavis/JD.Efcpt.Build.svg)](LICENSE)\n[![CI](https://github.com/JerrettDavis/JD.Efcpt.Build/actions/workflows/ci.yml/badge.svg)](https://github.com/JerrettDavis/JD.Efcpt.Build/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/JerrettDavis/JD.Efcpt.Build/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/JerrettDavis/JD.Efcpt.Build/security/code-scanning)\n[![codecov](https://codecov.io/gh/JerrettDavis/JD.Efcpt.Build/branch/main/graph/badge.svg)](https://codecov.io/gh/JerrettDavis/JD.Efcpt.Build)\n\n**MSBuild integration for EF Core Power Tools CLI**\n\nAutomate database-first EF Core model generation during `dotnet build`. Zero manual steps, full CI/CD support, reproducible builds.\n\n## Quick Start\n\n### Option A: Project Template (Easiest)\n\n```bash\ndotnet new install JD.Efcpt.Build.Templates\ndotnet new efcptbuild --name MyDataProject\ndotnet build\n```\n\n### Option B: SDK Approach (Recommended)\n\n```xml\n\u003cProject Sdk=\"JD.Efcpt.Sdk/PACKAGE_VERSION\"\u003e\n    \u003cPropertyGroup\u003e\n        \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\n    \u003c/PropertyGroup\u003e\n\u003c/Project\u003e\n```\n\n### Option C: PackageReference\n\n```bash\ndotnet add package JD.Efcpt.Build\ndotnet build\n```\n\n\u003e **.NET 8-9 users:** Install the CLI tool first: `dotnet tool install -g ErikEJ.EFCorePowerTools.Cli --version \"10.*\"`\n\u003e\n\u003e **.NET 10+ users:** No tool installation needed - uses `dnx` automatically.\n\n## Available Packages\n\n| Package | Purpose | Usage |\n|---------|---------|-------|\n| [JD.Efcpt.Build](https://www.nuget.org/packages/JD.Efcpt.Build/) | MSBuild integration | Add as `PackageReference` |\n| [JD.Efcpt.Sdk](https://www.nuget.org/packages/JD.Efcpt.Sdk/) | SDK package (cleanest setup) | Use as project SDK |\n| [JD.Efcpt.Build.Templates](https://www.nuget.org/packages/JD.Efcpt.Build.Templates/) | Project templates | `dotnet new install` |\n\n## Key Features\n\n- **Automatic generation** - DbContext and entities generated during `dotnet build`\n- **Incremental builds** - Only regenerates when schema or config changes\n- **Database-First SqlProj Generation** - Extract schema from live databases to DACPAC (NEW!)\n- **Dual input modes** - Works with SQL Projects (.sqlproj) or live database connections\n- **Smart discovery** - Auto-finds database projects and configuration files\n- **T4 template support** - Customize code generation with your own templates\n- **Multi-schema support** - Generate models across multiple database schemas\n- **CI/CD ready** - Works everywhere .NET runs (GitHub Actions, Azure DevOps, Docker)\n- **Cross-platform SQL Projects** - Supports Microsoft.Build.Sql and MSBuild.Sdk.SqlProj\n\n## Documentation\n\n| Topic | Description |\n|-------|-------------|\n| [Getting Started](docs/user-guide/getting-started.md) | Installation and first project setup |\n| [Using the SDK](docs/user-guide/sdk.md) | SDK approach for cleanest project files |\n| [Configuration](docs/user-guide/configuration.md) | MSBuild properties and JSON config options |\n| [Connection String Mode](docs/user-guide/connection-string-mode.md) | Generate from live databases |\n| [T4 Templates](docs/user-guide/t4-templates.md) | Customize code generation |\n| [CI/CD Integration](docs/user-guide/ci-cd.md) | GitHub Actions, Azure DevOps, Docker |\n| [Troubleshooting](docs/user-guide/troubleshooting.md) | Common issues and solutions |\n| [API Reference](docs/user-guide/api-reference.md) | Complete MSBuild properties and tasks |\n| [Core Concepts](docs/user-guide/core-concepts.md) | How the build pipeline works |\n| [Architecture](docs/architecture/README.md) | Internal architecture details |\n\n## Requirements\n\n- **.NET SDK 8.0+**\n- **EF Core Power Tools CLI** - Auto-executed via `dnx` on .NET 10+; requires manual install on .NET 8-9\n- **Database source** - SQL Server Database Project (.sqlproj) or live database connection\n\n### Supported SQL Project Types\n\n| Type | Extension | Cross-Platform |\n|------|-----------|----------------|\n| [Microsoft.Build.Sql](https://github.com/microsoft/DacFx) | `.sqlproj` | Yes |\n| [MSBuild.Sdk.SqlProj](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj) | `.csproj` / `.fsproj` | Yes |\n| Traditional SQL Projects | `.sqlproj` | Windows only |\n\n## New: Database-First SQL Generation\n\nAutomatically generate SQL scripts from your live database when JD.Efcpt.Build detects it's referenced in a SQL project:\n\n**DatabaseProject** (SQL):\n```xml\n\u003cProject Sdk=\"MSBuild.Sdk.SqlProj/3.3.0\"\u003e\n    \u003cPropertyGroup\u003e\n        \u003cEfcptConnectionString\u003eServer=...;Database=MyDb;...\u003c/EfcptConnectionString\u003e\n    \u003c/PropertyGroup\u003e\n    \u003cItemGroup\u003e\n        \u003cPackageReference Include=\"JD.Efcpt.Build\" Version=\"PACKAGE_VERSION\" /\u003e\n    \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n```\n\n**DataAccessProject** (EF Core):\n```xml\n\u003cItemGroup\u003e\n    \u003cProjectReference Include=\"..\\DatabaseProject\\DatabaseProject.csproj\" /\u003e\n    \u003cPackageReference Include=\"JD.Efcpt.Build\" Version=\"PACKAGE_VERSION\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\nThis enables the complete two-project workflow:\n\n```\nLive Database → SQL Scripts (in SQL Project) → DACPAC → EF Core Models (in DataAccess Project)\n```\n\n**Benefits:**\n- ✅ Automatic SQL project detection (no configuration needed)\n- ✅ Database as source of truth\n- ✅ Human-readable SQL scripts for review and version control\n- ✅ Clean separation: Database project (schema) + DataAccess project (models)\n- ✅ Incremental builds with schema fingerprinting\n- ✅ Works with .NET 10+ `dnx` (no sqlpackage installation required)\n\nSee the [Database-First SQL Generation sample](samples/database-first-sql-generation/) for a complete example.\n\n## Samples\n\nSee the [samples directory](samples/) for complete working examples:\n\n- [Simple Generation](samples/simple-generation/) - Basic DACPAC-based generation\n- [SDK Zero Config](samples/sdk-zero-config/) - Minimal SDK project setup\n- [Database-First SQL Generation](samples/database-first-sql-generation/) - Auto-generate SQL scripts from live database (NEW!)\n- [Connection String Mode](samples/connection-string-sqlite/) - Generate from live database\n- [Custom Renaming](samples/custom-renaming/) - Table and column renaming\n- [Schema Organization](samples/schema-organization/) - Multi-schema folder structure\n- [Split Outputs](samples/split-data-and-models-between-multiple-projects/) - Separate Models and Data projects\n\n## Contributing\n\nContributions are welcome! Please open an issue first to discuss changes. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n## Acknowledgments\n\n- **[EF Core Power Tools](https://github.com/ErikEJ/EFCorePowerTools)** by Erik Ejlskov Jensen - The tool this package automates\n- **Microsoft** - For Entity Framework Core and MSBuild\n\n## Support\n\n- [GitHub Issues](https://github.com/jerrettdavis/JD.Efcpt.Build/issues) - Bug reports and feature requests\n- [GitHub Discussions](https://github.com/jerrettdavis/JD.Efcpt.Build/discussions) - Questions and community support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerrettdavis%2Fjd.efcpt.build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerrettdavis%2Fjd.efcpt.build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerrettdavis%2Fjd.efcpt.build/lists"}