This sample demonstrates using JD.Efcpt.Build with the MSBuild.Sdk.SqlProj SDK.
MSBuild.Sdk.SqlProj:
- Uses
.csprojor.fsprojfile extension (not.sqlproj) - Community-maintained SDK with additional features and extensibility
- Cross-platform: works on Linux/macOS/Windows
- More similar to the legacy .NET Framework SQL Projects
Microsoft.Build.Sql:
- Uses
.sqlprojfile extension - Microsoft's official SDK for SQL Projects in .NET SDK
- Cross-platform: works on Linux/macOS/Windows
Both produce DACPACs that work with JD.Efcpt.Build.
DatabaseProject/- MSBuild.Sdk.SqlProj project (uses.csprojextension)EntityFrameworkCoreProject/- .NET project that consumes the generated EF Core models
This sample imports JD.Efcpt.Build directly from source rather than consuming it as a NuGet package. This makes it ideal for:
- Developing and testing JD.Efcpt.Build itself
- Seeing how the build targets work without NuGet packaging complexity
- Quick iteration during development
The EntityFrameworkCoreProject.csproj uses:
<Import Project="$(EfcptBuildRoot)build\JD.Efcpt.Build.props" />
<Import Project="$(EfcptBuildRoot)build\JD.Efcpt.Build.targets" />This is the same approach used by the test assets in tests/TestAssets/SampleApp.
# From this directory
dotnet buildThe build will:
- Build the DatabaseProject to a DACPAC
- Run the Efcpt pipeline to generate EF Core models
- Compile the generated models into the application
In a real project, you would consume JD.Efcpt.Build as a NuGet package:
<ItemGroup>
<PackageReference Include="JD.Efcpt.Build" Version="PACKAGE_VERSION" />
</ItemGroup>The NuGet package automatically imports the props and targets files, so you don't need explicit <Import> statements.
See the main README.md for full documentation on NuGet package consumption.
efcpt-config.json- EF Core Power Tools configurationefcpt.renaming.json- Renaming rules for generated code
These files are automatically discovered by the build pipeline.
