Skip to content

Commit 9a72229

Browse files
authored
docs: removed README artifacts from previous update. Updated sqlproj references (#18)
1 parent 6ce6886 commit 9a72229

10 files changed

Lines changed: 140 additions & 109 deletions

File tree

QUICKSTART.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ dotnet build
2727
```
2828
MySolution/
2929
├── src/MyApp/MyApp.csproj
30-
└── database/MyDb/MyDb.sqlproj
30+
└── database/MyDb/
31+
└── MyDb.sqlproj # Microsoft.Build.Sql
32+
# OR MyDb.csproj # MSBuild.Sdk.SqlProj
3133
```
3234

3335
**MyApp.csproj:**
@@ -38,6 +40,8 @@ MySolution/
3840

3941
<PropertyGroup>
4042
<EfcptSqlProj>..\..\database\MyDb\MyDb.sqlproj</EfcptSqlProj>
43+
<!-- For Microsoft.Build.Sql, use .sqlproj -->
44+
<!-- For MSBuild.Sdk.SqlProj, use .csproj or .fsproj -->
4145
</PropertyGroup>
4246
```
4347

@@ -154,6 +158,7 @@ Templates automatically staged to `obj/efcpt/Generated/CodeTemplates/`
154158
```xml
155159
<PropertyGroup>
156160
<EfcptSqlProj>..\..\database\MyDb\MyDb.sqlproj</EfcptSqlProj>
161+
<!-- For Microsoft.Build.Sql, use .sqlproj; for MSBuild.Sdk.SqlProj, use .csproj/.fsproj -->
157162
</PropertyGroup>
158163
```
159164

@@ -288,8 +293,9 @@ dotnet tool restore
288293

289294
**Quick Fix:**
290295
```bash
291-
# Test database project independently
296+
# Test SQL Project independently
292297
dotnet build path\to\Database.sqlproj
298+
# Or for MSBuild.Sdk.SqlProj: dotnet build path\to\Database.csproj
293299
```
294300

295301
### Issue: Old schema still generating
@@ -319,7 +325,7 @@ dotnet build
319325

320326
| Property | Use When | Example |
321327
|----------|----------|---------|
322-
| `EfcptSqlProj` | Database project not auto-discovered | `..\..\db\MyDb.sqlproj` |
328+
| `EfcptSqlProj` | SQL Project not auto-discovered | `..\..\db\MyDb.sqlproj` or `..\..\db\MyDb.csproj` |
323329
| `EfcptConfig` | Using custom config file name | `my-config.json` |
324330
| `EfcptTemplateDir` | Using custom template location | `CustomTemplates` |
325331
| `EfcptLogVerbosity` | Debugging issues | `detailed` |
@@ -422,10 +428,12 @@ YourProject/
422428

423429
<PropertyGroup Condition="'$(Environment)' == 'Development'">
424430
<EfcptSqlProj>..\..\database\Dev\Dev.sqlproj</EfcptSqlProj>
431+
<!-- Or Dev.csproj for MSBuild.Sdk.SqlProj -->
425432
</PropertyGroup>
426433

427434
<PropertyGroup Condition="'$(Environment)' == 'Production'">
428435
<EfcptSqlProj>..\..\database\Prod\Prod.sqlproj</EfcptSqlProj>
436+
<!-- Or Prod.csproj for MSBuild.Sdk.SqlProj -->
429437
</PropertyGroup>
430438
```
431439

@@ -444,6 +452,7 @@ YourProject/
444452
<PropertyGroup>
445453
<!-- Project-specific override -->
446454
<EfcptSqlProj>..\..\database\MyDb\MyDb.sqlproj</EfcptSqlProj>
455+
<!-- For Microsoft.Build.Sql, use .sqlproj; for MSBuild.Sdk.SqlProj, use .csproj/.fsproj -->
447456
</PropertyGroup>
448457
```
449458

README.md

Lines changed: 43 additions & 48 deletions
Large diffs are not rendered by default.

docs/user-guide/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Set these properties in your `.csproj` file or `Directory.Build.props`.
1919
| Property | Default | Description |
2020
|----------|---------|-------------|
2121
| `EfcptEnabled` | `true` | Master switch for the entire pipeline |
22-
| `EfcptSqlProj` | *(auto-discovered)* | Path to `.sqlproj` file |
23-
| `EfcptDacpac` | *(empty)* | Path to pre-built `.dacpac` file (skips .sqlproj build) |
22+
| `EfcptSqlProj` | *(auto-discovered)* | Path to SQL Project file (`.sqlproj` for Microsoft.Build.Sql, `.csproj`/`.fsproj` for MSBuild.Sdk.SqlProj) |
23+
| `EfcptDacpac` | *(empty)* | Path to pre-built `.dacpac` file (skips SQL Project build) |
2424
| `EfcptConfig` | `efcpt-config.json` | EF Core Power Tools configuration file |
2525
| `EfcptRenaming` | `efcpt.renaming.json` | Renaming rules file |
2626
| `EfcptTemplateDir` | `Template` | T4 template directory |

docs/user-guide/core-concepts.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ The pipeline consists of seven stages that run before C# compilation:
2020
**Purpose**: Discover the database source and locate all configuration files.
2121

2222
**What it does**:
23-
- Locates the SQL Server Database Project (.sqlproj) from project references or explicit configuration
23+
- Locates the SQL Project from project references or explicit configuration
2424
- Resolves the EF Core Power Tools configuration file (`efcpt-config.json`)
2525
- Finds renaming rules (`efcpt.renaming.json`)
2626
- Discovers T4 template directories
2727
- Resolves connection strings from various sources (explicit property, appsettings.json, app.config)
2828

2929
**Outputs**:
30-
- `SqlProjPath` - Path to the discovered database project
30+
- `SqlProjPath` - Path to the discovered SQL Project
3131
- `ResolvedConfigPath` - Path to the configuration file
3232
- `ResolvedRenamingPath` - Path to renaming rules
3333
- `ResolvedTemplateDir` - Path to templates
@@ -37,8 +37,8 @@ The pipeline consists of seven stages that run before C# compilation:
3737

3838
**Purpose**: Prepare the schema source for code generation.
3939

40-
**DACPAC Mode** (when using .sqlproj):
41-
- Builds the SQL Server Database Project to produce a DACPAC file
40+
**DACPAC Mode** (when using SQL Project):
41+
- Builds the SQL Project to produce a DACPAC file
4242
- Only rebuilds if source files are newer than the existing DACPAC
4343
- Uses `msbuild.exe` on Windows or `dotnet msbuild` on other platforms
4444

@@ -200,22 +200,25 @@ For each input type, the package searches in this order:
200200

201201
### SQL Project Discovery
202202

203-
The package discovers SQL projects by:
203+
The package discovers SQL Projects by:
204204

205205
1. Checking `EfcptSqlProj` property (if set)
206-
2. Scanning `ProjectReference` items for .sqlproj files
207-
3. Looking for .sqlproj in the solution directory
208-
4. Checking for modern SDK-style SQL projects
206+
2. Scanning `ProjectReference` items for SQL Projects
207+
3. Looking for SQL Projects in the solution directory
208+
4. Checking for modern SDK-style SQL Projects
209209

210210
**Supported SQL Project SDKs:**
211211

212-
| SDK | Cross-Platform | Notes |
213-
|-----|----------------|-------|
214-
| [Microsoft.Build.Sql](https://github.com/microsoft/DacFx) | Yes | Microsoft's official SDK-style SQL projects |
215-
| [MSBuild.Sdk.SqlProj](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj) | Yes | Popular community SDK |
216-
| Traditional .sqlproj | No (Windows only) | Requires SQL Server Data Tools |
212+
| SDK | Extension | Cross-Platform | Notes |
213+
|-----|-----------|----------------|-------|
214+
| [Microsoft.Build.Sql](https://github.com/microsoft/DacFx) | `.sqlproj` | Yes | Microsoft's official SDK-style SQL Projects for .NET |
215+
| [MSBuild.Sdk.SqlProj](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj) | `.csproj` or `.fsproj` | Yes | Community SDK with additional features and extensibility |
216+
| Traditional SQL Projects | `.sqlproj` | No (Windows only) | Legacy format, requires SQL Server Data Tools |
217217

218-
Both SDK-style projects work identically - they produce DACPACs that JD.Efcpt.Build uses for code generation.
218+
**Key Differences:**
219+
- **Microsoft.Build.Sql** uses the `.sqlproj` extension and is Microsoft's official modern SDK for SQL Projects in .NET SDK
220+
- **MSBuild.Sdk.SqlProj** uses `.csproj` or `.fsproj` extensions (despite having "SqlProj" in its name), provides more configurability and extensibility
221+
- Both SDK-style projects produce DACPACs that JD.Efcpt.Build uses for code generation
219222

220223
## Generated File Naming
221224

docs/user-guide/getting-started.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Before you begin, ensure you have:
88

99
- **.NET SDK 8.0 or later** installed
1010
- One of:
11-
- A **SQL Server Database Project** (.sqlproj) that produces a DACPAC
11+
- A **SQL Server Database Project** that produces a DACPAC
1212
- A live database connection (SQL Server, PostgreSQL, MySQL, SQLite, Oracle, Firebird, or Snowflake)
1313
- Basic familiarity with MSBuild and NuGet
1414

@@ -65,7 +65,7 @@ dotnet build
6565

6666
On the first build, the package will:
6767

68-
1. Discover your SQL Server Database Project
68+
1. Discover your SQL Project
6969
2. Build it to a DACPAC
7070
3. Run the EF Core Power Tools CLI
7171
4. Generate DbContext and entity classes
@@ -95,26 +95,29 @@ YourSolution/
9595
│ └── efcpt-config.json # Optional: customize generation
9696
└── database/
9797
└── YourDatabase/
98-
└── YourDatabase.sqlproj # Your database project
98+
└── YourDatabase.sqlproj # Your SQL Project (Microsoft.Build.Sql)
99+
# OR YourDatabase.csproj (MSBuild.Sdk.SqlProj)
99100
```
100101

101102
## Minimal Configuration
102103

103104
For most projects, no configuration is required. The package uses sensible defaults:
104105

105-
- Auto-discovers `.sqlproj` in your solution
106+
- Auto-discovers SQL Project in your solution (`.sqlproj` for Microsoft.Build.Sql, `.csproj`/`.fsproj` for MSBuild.Sdk.SqlProj)
106107
- Uses `efcpt-config.json` if present
107108
- Generates to `obj/efcpt/Generated/`
108109
- Enables nullable reference types
109110
- Organizes files by database schema
110111

111-
### Explicit Database Project Path
112+
### Explicit SQL Project Path
112113

113-
If auto-discovery doesn't find your database project, specify it explicitly:
114+
If auto-discovery doesn't find your SQL Project, specify it explicitly:
114115

115116
```xml
116117
<PropertyGroup>
117118
<EfcptSqlProj>..\database\YourDatabase\YourDatabase.sqlproj</EfcptSqlProj>
119+
<!-- For Microsoft.Build.Sql, use .sqlproj extension -->
120+
<!-- For MSBuild.Sdk.SqlProj, use .csproj or .fsproj extension -->
118121
</PropertyGroup>
119122
```
120123

@@ -146,7 +149,7 @@ Create `efcpt-config.json` in your project directory to customize generation:
146149

147150
## Using a Live Database
148151

149-
If you don't have a .sqlproj, you can generate models directly from a database connection. JD.Efcpt.Build supports multiple database providers:
152+
If you don't have a SQL Project, you can generate models directly from a database connection. JD.Efcpt.Build supports multiple database providers:
150153

151154
| Provider | Value | Example |
152155
|----------|-------|---------|
@@ -237,7 +240,7 @@ dotnet build
237240

238241
### Database project not found
239242

240-
If the package can't find your .sqlproj:
243+
If the package can't find your SQL Project:
241244

242245
1. Ensure the project exists and builds independently
243246
2. Set `EfcptSqlProj` explicitly in your .csproj

docs/user-guide/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ JD.Efcpt.Build eliminates this manual step by:
1010

1111
- **Automating code generation** during `dotnet build`
1212
- **Detecting schema changes** using fingerprinting to avoid unnecessary regeneration
13-
- **Supporting multiple input sources** including SQL Server Database Projects (.sqlproj) and live database connections
13+
- **Supporting multiple input sources** including SQL Projects and live database connections
1414
- **Enabling CI/CD workflows** where models are generated consistently on any build machine
1515

1616
## When to Use JD.Efcpt.Build
1717

1818
Use this package when:
1919

20-
- You have a SQL Server database described by a Database Project (`.sqlproj`) and want EF Core models generated automatically
20+
- You have a SQL Server database described by a SQL Project and want EF Core models generated automatically
2121
- You want EF Core Power Tools generation to run as part of `dotnet build` instead of being a manual step
2222
- You need deterministic, source-controlled model generation that works identically on developer machines and in CI/CD
2323
- You're working in a team environment and need consistent code generation across developers
@@ -74,13 +74,13 @@ Models are only regenerated when this fingerprint changes, making subsequent bui
7474

7575
### Dual Input Modes
7676

77-
**DACPAC Mode** (Default): Works with SQL Server Database Projects
78-
- Automatically builds your .sqlproj to a DACPAC
77+
**DACPAC Mode** (Default): Works with SQL Projects
78+
- Automatically builds your SQL Project to a DACPAC
7979
- Generates models from the DACPAC schema
8080

8181
**Connection String Mode**: Works with live databases
8282
- Connects directly to a database server
83-
- No .sqlproj required
83+
- No SQL Project required
8484
- Ideal for cloud databases or existing production systems
8585

8686
### Smart Discovery

samples/README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,40 @@ This directory contains sample projects demonstrating various usage patterns of
66

77
| Sample | Input Mode | SQL SDK / Provider | Key Features |
88
|--------|------------|-------------------|--------------|
9-
| [simple-generation](#simple-generation) | DACPAC | Traditional .sqlproj | Basic usage, direct source import |
10-
| [msbuild-sdk-sql-proj-generation](#msbuild-sdk-sql-proj-generation) | DACPAC | MSBuild.Sdk.SqlProj | Modern cross-platform SQL SDK |
11-
| [split-data-and-models-between-multiple-projects](#split-outputs) | DACPAC | Traditional .sqlproj | Clean architecture, split outputs |
9+
| [simple-generation](#simple-generation) | DACPAC | Traditional SQL Project (.sqlproj) | Basic usage, direct source import |
10+
| [msbuild-sdk-sql-proj-generation](#msbuild-sdk-sql-proj-generation) | DACPAC | MSBuild.Sdk.SqlProj (.csproj) | Modern cross-platform SQL SDK |
11+
| [split-data-and-models-between-multiple-projects](#split-outputs) | DACPAC | Traditional SQL Project (.sqlproj) | Clean architecture, split outputs |
1212
| [connection-string-sqlite](#connection-string-sqlite) | Connection String | SQLite | Direct database reverse engineering |
1313

1414
## Input Modes
1515

1616
JD.Efcpt.Build supports two primary input modes:
1717

1818
### 1. DACPAC Mode (Default)
19-
Reverse engineers from a SQL Server Database Project that produces a .dacpac file.
19+
Reverse engineers from a SQL Project that produces a .dacpac file.
2020

21-
JD.Efcpt.Build supports multiple SQL project SDKs:
21+
JD.Efcpt.Build supports multiple SQL Project SDKs:
2222

23-
| SDK | Cross-Platform | Notes |
24-
|-----|----------------|-------|
25-
| [Microsoft.Build.Sql](https://github.com/microsoft/DacFx) | Yes | Microsoft's official SDK-style SQL projects |
26-
| [MSBuild.Sdk.SqlProj](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj) | Yes | Popular community SDK for cross-platform builds |
27-
| Traditional .sqlproj | No (Windows only) | Requires SQL Server Data Tools |
23+
| SDK | Extension | Cross-Platform | Notes |
24+
|-----|-----------|----------------|-------|
25+
| [Microsoft.Build.Sql](https://github.com/microsoft/DacFx) | `.sqlproj` | Yes | Microsoft's official SDK-style SQL Projects for .NET |
26+
| [MSBuild.Sdk.SqlProj](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj) | `.csproj` or `.fsproj` | Yes | Community SDK with additional features and extensibility |
27+
| Traditional SQL Projects | `.sqlproj` | No (Windows only) | Legacy format, requires SQL Server Data Tools |
2828

2929
```xml
3030
<ItemGroup>
3131
<ProjectReference Include="..\Database\Database.sqlproj">
3232
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
3333
</ProjectReference>
34+
<!-- Use .sqlproj for Microsoft.Build.Sql -->
35+
<!-- Use .csproj or .fsproj for MSBuild.Sdk.SqlProj -->
3436
</ItemGroup>
3537
```
3638

37-
Both SDK-style projects work identically with JD.Efcpt.Build - the package automatically detects and builds them.
39+
**Key Differences:**
40+
- **Microsoft.Build.Sql** uses `.sqlproj` extension and is Microsoft's official SDK
41+
- **MSBuild.Sdk.SqlProj** uses `.csproj`/`.fsproj` extension (despite having "SqlProj" in its name)
42+
- Both produce DACPACs and work identically with JD.Efcpt.Build
3843

3944
### 2. Connection String Mode
4045
Reverse engineers directly from a live database connection.
@@ -70,8 +75,8 @@ Basic sample demonstrating DACPAC-based model generation with direct source impo
7075

7176
```
7277
simple-generation/
73-
├── DatabaseProject/ # SQL Server Database Project
74-
│ └── DatabaseProject.sqlproj
78+
├── DatabaseProject/ # SQL Project
79+
│ └── DatabaseProject.sqlproj # Traditional format
7580
├── EntityFrameworkCoreProject/
7681
│ ├── EntityFrameworkCoreProject.csproj
7782
│ ├── efcpt-config.json
@@ -90,24 +95,24 @@ dotnet build simple-generation/SimpleGenerationSample.sln
9095

9196
**Location:** `msbuild-sdk-sql-proj-generation/`
9297

93-
Demonstrates using a modern SDK-style SQL project (MSBuild.Sdk.SqlProj) for cross-platform DACPAC builds. This sample works on Windows, Linux, and macOS.
98+
Demonstrates using MSBuild.Sdk.SqlProj for cross-platform DACPAC builds. This SDK uses `.csproj` extension (not `.sqlproj`).
9499

95100
```
96101
msbuild-sdk-sql-proj-generation/
97102
├── DatabaseProject/ # MSBuild.Sdk.SqlProj project
98-
│ └── DatabaseProject.csproj
103+
│ └── DatabaseProject.csproj # Uses .csproj extension
99104
├── EntityFrameworkCoreProject/
100105
│ ├── EntityFrameworkCoreProject.csproj
101106
│ └── efcpt-config.json
102107
└── SimpleGenerationSample.sln
103108
```
104109

105110
**Key Features:**
106-
- Uses `MSBuild.Sdk.SqlProj` SDK for the database project (cross-platform)
107-
- Works identically to traditional .sqlproj but runs on any OS
108-
- Dynamic SQL project discovery (no explicit reference needed)
111+
- Uses `MSBuild.Sdk.SqlProj` SDK for the SQL Project (note: uses `.csproj` extension)
112+
- Works on Windows, Linux, and macOS
113+
- Dynamic SQL Project discovery (no explicit reference needed)
109114

110-
> **Note:** You can also use `Microsoft.Build.Sql` SDK, which is Microsoft's official SDK-style SQL project format. Both SDKs are fully supported.
115+
> **Note:** Despite having "SqlProj" in its name, MSBuild.Sdk.SqlProj uses `.csproj` or `.fsproj` extensions, not `.sqlproj`.
111116
112117
---
113118

@@ -120,7 +125,7 @@ Advanced sample showing how to split generated output across multiple projects f
120125
```
121126
split-data-and-models-between-multiple-projects/
122127
└── src/
123-
├── SampleApp.Sql/ # SQL Database Project
128+
├── SampleApp.Sql/ # SQL Project (Microsoft.Build.Sql format)
124129
├── SampleApp.Models/ # Entity classes only (NO EF Core)
125130
└── SampleApp.Data/ # DbContext + EF Core dependencies
126131
```
@@ -145,7 +150,7 @@ split-data-and-models-between-multiple-projects/
145150

146151
**Location:** `connection-string-sqlite/`
147152

148-
Demonstrates connection string mode with SQLite - no SQL project needed, reverse engineers directly from a database.
153+
Demonstrates connection string mode with SQLite - no SQL Project needed, reverse engineers directly from a database.
149154

150155
```
151156
connection-string-sqlite/

samples/msbuild-sdk-sql-proj-generation/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
# Simple Generation Sample
1+
# MSBuild.Sdk.SqlProj Generation Sample
22

3-
This sample demonstrates using `JD.Efcpt.Build` to generate EF Core models from a SQL Server Database Project.
3+
This sample demonstrates using `JD.Efcpt.Build` with the **[MSBuild.Sdk.SqlProj](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj)** SDK.
4+
5+
## Key Differences from Microsoft.Build.Sql
6+
7+
**MSBuild.Sdk.SqlProj**:
8+
- Uses `.csproj` or `.fsproj` file extension (not `.sqlproj`)
9+
- Community-maintained SDK with additional features and extensibility
10+
- Cross-platform: works on Linux/macOS/Windows
11+
- More similar to the legacy .NET Framework SQL Projects
12+
13+
**Microsoft.Build.Sql**:
14+
- Uses `.sqlproj` file extension
15+
- Microsoft's official SDK for SQL Projects in .NET SDK
16+
- Cross-platform: works on Linux/macOS/Windows
17+
18+
Both produce DACPACs that work with JD.Efcpt.Build.
419

520
## Project Structure
621

7-
- `DatabaseProject/` - SQL Server Database Project that defines the schema
22+
- `DatabaseProject/` - MSBuild.Sdk.SqlProj project (uses `.csproj` extension)
823
- `EntityFrameworkCoreProject/` - .NET project that consumes the generated EF Core models
924

1025
## How It Works

0 commit comments

Comments
 (0)