Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fe373c4
style: fix whitespace and indentation
nmummau Oct 17, 2026
53f7841
style: remove unused GUI usings
nmummau Oct 17, 2026
647c277
build: enforce formatting in Release builds
nmummau Oct 17, 2026
5e4d78f
chore: move editorconfig to the repo's root so it covers all slnx
nmummau Oct 17, 2026
5f8a521
ci: verify formatting in both solutions
nmummau Oct 17, 2026
01fbc4d
style: normalize UTF-8 encoding
nmummau Oct 17, 2026
27abb5a
style: align final newlines with EditorConfig
nmummau Oct 17, 2026
c48971c
style: fix whitespace in tests and scaffolding examples
nmummau Oct 17, 2026
2ddc3f1
style: remove unused usings from tests and scaffolding examples
nmummau Oct 17, 2026
fd6cfb9
refactor: replace internal scaffolder fields with properties
nmummau Oct 17, 2026
fd09bd1
style: align GUI constant names with naming rules
nmummau Oct 17, 2026
5ab547f
fix: use invariant formatting in scaffolding SQL helper
nmummau Oct 17, 2026
2dd2852
docs: dotnet format code formating for contributors
nmummau Oct 17, 2026
54cf262
style: correct the scope of .NET EditorConfig settings
nmummau Oct 17, 2026
5fda638
style: reorder imports in core tests
nmummau Oct 17, 2026
6c2f038
style: reorder imports in scaffolding examples
nmummau Oct 17, 2026
5c34998
style: use file-scoped namespaces in core tests
nmummau Oct 17, 2026
78535ce
style: use file-scoped namespaces in core tools
nmummau Oct 17, 2026
3d166e9
style: use file-scoped namespaces in scaffolding examples
nmummau Oct 17, 2026
d181499
style: recognize generated DacFx interfaces and implementations
nmummau Oct 17, 2026
50e91b0
style: align handwritten DacFx support code with analyzer rules
nmummau Oct 17, 2026
5659e24
style: simplify type names and collection initialization
nmummau Oct 17, 2026
8703ca3
style: align scaffolding examples with analyzer rules
nmummau Oct 17, 2026
5d93733
style: clean up core test fixtures and helpers
nmummau Oct 17, 2026
5da89af
style: simplify expressions and remove redundant assignments
nmummau Oct 17, 2026
04f5b11
style: align provider dictionary initializer indentation
nmummau Oct 17, 2026
0c3f111
style: handle unused parameters without breaking public signatures
nmummau Oct 17, 2026
3c6943c
style: use file-scoped namespaces in Windows components
nmummau Oct 17, 2026
a30cd40
style: use file-scoped namespaces in GUI tests
nmummau Oct 17, 2026
e433bf9
fix: remove unnecessary async from scaffolding hosted service
nmummau Oct 17, 2026
f0bddce
style: declare accessibility on view-model interface members
nmummau Oct 20, 2026
9272a6a
style: declare accessibility on dialog and wizard interface members
nmummau Oct 20, 2026
b17f834
style: declare accessibility on service interface members
nmummau Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trim_trailing_whitespace = true
indent_style = tab

# Visual Studio XML Project Files
[*.{csproj,vcxproj.filters,proj,projitems,shproj}]
[*.{csproj,vcxproj.filters,proj,projitems,shproj,slnx}]
indent_size = 2

# XML Configuration Files
Expand Down Expand Up @@ -75,6 +75,8 @@ indent_style = tab
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions
##########################################

[*.{cs,csx,cake}]

# Default Severity for .NET Code Style
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
dotnet_analyzer_diagnostic.severity = error
Expand All @@ -86,7 +88,6 @@ dotnet_separate_import_directive_groups = false

# .NET Code Style Settings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
[*.{cs,csx,cake}]

# "this." and "Me." qualifiers
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
Expand Down Expand Up @@ -157,6 +158,8 @@ csharp_style_var_elsewhere = true
# Namespace declaration preferences
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161?view=vs-2022
csharp_style_namespace_declarations = file_scoped # IDE0160 and IDE0161
# Keep explicit Program classes; top-level statements conflict with insert_final_newline = false.
csharp_style_prefer_top_level_statements = false # IDE0210 and IDE0211

# Expression-bodied members
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
Expand Down Expand Up @@ -509,7 +512,7 @@ dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
dotnet_diagnostic.IDE0055.severity = warning # Fix formatting
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
Expand Down Expand Up @@ -571,3 +574,20 @@ dotnet_diagnostic.SA1518.severity = none # Newline at the end of the file

[PatchedSqlServerDatabaseModelFactory.cs]
generated_code = true

# Generated by the matching T4 templates in microsoft/DACExtensions.
# https://github.com/microsoft/DACExtensions/tree/master/DacFxStronglyTypedModel
[src/Core/DacFxStrongTypedCore.161/{Interfaces,VersionSpecificImplementations}.cs]
generated_code = true


# Preserve checked-in scaffolding output, including models generated from T4 templates.
[test/ScaffoldingTester/**/Models/**.cs]
generated_code = true

# Custom partial classes are maintained by hand and should follow the shared rules.
[test/ScaffoldingTester/**/Models/*.{custom,Custom}.cs]
generated_code = false

[test/ScaffoldingTester/ScaffoldingTester5/Models/StringSplitResult.cs]
generated_code = false
37 changes: 28 additions & 9 deletions .github/workflows/vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
paths-ignore:
- '**/*'
- '!.github/workflows/vsix.yml'
- '!src/GUI/**/*'
- '!src/Core/**/*'
- '!.editorconfig'
- '!src/**/*'
- '!test/ScaffoldingTester/**/*'
branches:
- 'master'
pull_request:
Expand Down Expand Up @@ -36,6 +37,31 @@ jobs:
with:
dotnet-version: '10.0.x'

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v3

# Verify checked-in source before Update Version modifies it.
- name: Verify formatting
shell: pwsh
env:
DOTNET_CLI_UI_LANGUAGE: en-US
run: |
$solutions = @('src/EFCorePowerTools.slnx', 'test/ScaffoldingTester/ScaffoldingTester.slnx')
foreach ($solution in $solutions) {
Write-Host "Restoring: $solution"
msbuild $solution /t:Restore /p:Configuration=Debug /v:minimal /nologo
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

Write-Host "Verifying formatting: $solution"
$formatOutput = dotnet format $solution --verify-no-changes --no-restore --verbosity diagnostic 2>&1
$formatExitCode = $LASTEXITCODE
$formatOutput | Write-Output
if ($formatExitCode -ne 0) { exit $formatExitCode }
if ($formatOutput -match 'Required references did not load for ') {
throw "Formatting verification is incomplete for $solution because project references could not be loaded."
}
}

- name: Update Version
run: |
((Get-Content -Path GUI/EFCorePowerTools/Properties/AssemblyInfo.cs -Raw) -Replace "2.6.0.1", "${{ env.VERSION }}") | Set-Content -Path GUI/EFCorePowerTools/Properties/AssemblyInfo.cs
Expand All @@ -44,10 +70,6 @@ jobs:
working-directory: src
shell: pwsh

- name: Restore
run: dotnet restore EFCorePowerTools.slnx
working-directory: src

- name: Build reveng tools
shell: cmd
run: |
Expand Down Expand Up @@ -80,9 +102,6 @@ jobs:
dir /a:-d /s /b "efreveng100" | find /c ":\" > filecount.txt
findstr "149" filecount.txt

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v3

- name: Build
run: msbuild EFCorePowerTools.slnx /property:Configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
working-directory: src
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ You can smoke test changes to reverse engineering. Launch one of the `efreveng`

In the `ScaffoldingTester` solution there are scripts to populate Northwind and Chinook databases with the required objects.

### Code formatting

CI build runs a **Verify formatting** step in the **VSIX** workflow to check both solutions against [`.editorconfig`](.editorconfig). If it fails and reports formatting violations, apply fixes from the repository root:

```sh
dotnet format src/EFCorePowerTools.slnx
dotnet format test/ScaffoldingTester/ScaffoldingTester.slnx
```

Some violations may need manual fixes. Rerun the commands with `--verify-no-changes` to see those locally:

```sh
dotnet format src/EFCorePowerTools.slnx --verify-no-changes
dotnet format test/ScaffoldingTester/ScaffoldingTester.slnx --verify-no-changes
```

## Support and sponsors

The tool and GitHub based support are free. A [rating or review](https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools&ssr=false#review-details) and [sponsorships](https://github.com/sponsors/ErikEJ) are greatly appreciated.
Expand Down
88 changes: 45 additions & 43 deletions src/Core/DacFxStrongTypedCore.161/ISqlModelElement.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//<copyright company="Microsoft">
//
// The MIT License (MIT)
Expand All @@ -24,47 +24,49 @@
// SOFTWARE.
//</copyright>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Dac.Extensions.Prototype
using System.Collections.Generic;
using Microsoft.SqlServer.Dac.Model;
using Microsoft.SqlServer.TransactSql.ScriptDom;

namespace Microsoft.SqlServer.Dac.Extensions.Prototype;

#pragma warning disable CA1716 // Preserve upstream public parameter names for callers using named arguments.
public interface ISqlModelElement
{
using System.Collections.Generic;
using Microsoft.SqlServer.Dac.Model;
using Microsoft.SqlServer.TransactSql.ScriptDom;
public interface ISqlModelElement
{
ObjectIdentifier Name { get; }
TSqlObject Element { get; }
TSqlScript GetAst();
IEnumerable<TSqlObject> GetChildren();
IEnumerable<TSqlObject> GetChildren(DacQueryScopes queryScopes);
object GetMetadata(ModelMetadataClass metadata);
T GetMetadata<T>(ModelMetadataClass metadata);
TSqlObject GetParent();
TSqlObject GetParent(DacQueryScopes queryScopes);
object GetProperty(ModelPropertyClass property);
T GetProperty<T>(ModelPropertyClass property);
IEnumerable<TSqlObject> GetReferenced();
IEnumerable<TSqlObject> GetReferenced(DacQueryScopes queryScopes);
IEnumerable<TSqlObject> GetReferenced(ModelRelationshipClass relationshipType);
IEnumerable<TSqlObject> GetReferenced(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances();
IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(DacExternalQueryScopes queryScopes);
IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(DacQueryScopes queryScopes);
IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(ModelRelationshipClass relationshipType);
IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(ModelRelationshipClass relationshipType, DacExternalQueryScopes queryScopes);
IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
IEnumerable<TSqlObject> GetReferencing();
IEnumerable<TSqlObject> GetReferencing(DacQueryScopes queryScopes);
IEnumerable<TSqlObject> GetReferencing(ModelRelationshipClass relationshipType);
IEnumerable<TSqlObject> GetReferencing(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances();
IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances(DacQueryScopes queryScopes);
IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances(ModelRelationshipClass relationshipType);
IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
string GetScript();
SourceInformation GetSourceInformation();
ModelTypeClass ObjectType { get; }
object this[ModelPropertyClass property] { get; }
bool TryGetAst(out TSqlScript objectAst);
bool TryGetScript(out string objectScript);
}
public ObjectIdentifier Name { get; }
public TSqlObject Element { get; }
public TSqlScript GetAst();
public IEnumerable<TSqlObject> GetChildren();
public IEnumerable<TSqlObject> GetChildren(DacQueryScopes queryScopes);
public object GetMetadata(ModelMetadataClass metadata);
public T GetMetadata<T>(ModelMetadataClass metadata);
public TSqlObject GetParent();
public TSqlObject GetParent(DacQueryScopes queryScopes);
public object GetProperty(ModelPropertyClass property);
public T GetProperty<T>(ModelPropertyClass property);
public IEnumerable<TSqlObject> GetReferenced();
public IEnumerable<TSqlObject> GetReferenced(DacQueryScopes queryScopes);
public IEnumerable<TSqlObject> GetReferenced(ModelRelationshipClass relationshipType);
public IEnumerable<TSqlObject> GetReferenced(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
public IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances();
public IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(DacExternalQueryScopes queryScopes);
public IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(DacQueryScopes queryScopes);
public IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(ModelRelationshipClass relationshipType);
public IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(ModelRelationshipClass relationshipType, DacExternalQueryScopes queryScopes);
public IEnumerable<ModelRelationshipInstance> GetReferencedRelationshipInstances(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
public IEnumerable<TSqlObject> GetReferencing();
public IEnumerable<TSqlObject> GetReferencing(DacQueryScopes queryScopes);
public IEnumerable<TSqlObject> GetReferencing(ModelRelationshipClass relationshipType);
public IEnumerable<TSqlObject> GetReferencing(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
public IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances();
public IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances(DacQueryScopes queryScopes);
public IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances(ModelRelationshipClass relationshipType);
public IEnumerable<ModelRelationshipInstance> GetReferencingRelationshipInstances(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes);
public string GetScript();
public SourceInformation GetSourceInformation();
public ModelTypeClass ObjectType { get; }
public object this[ModelPropertyClass property] { get; }
public bool TryGetAst(out TSqlScript objectAst);
public bool TryGetScript(out string objectScript);
}
#pragma warning restore CA1716
15 changes: 8 additions & 7 deletions src/Core/DacFxStrongTypedCore.161/ISqlModelElementReference.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//<copyright company="Microsoft">
//
// The MIT License (MIT)
Expand All @@ -25,11 +25,12 @@
//</copyright>
//------------------------------------------------------------------------------
using Microsoft.SqlServer.Dac.Model;
namespace Microsoft.SqlServer.Dac.Extensions.Prototype
{

public interface ISqlModelElementReference : ISqlModelElement
{
T GetMetadataProperty<T>(ModelPropertyClass property);
}
namespace Microsoft.SqlServer.Dac.Extensions.Prototype;

#pragma warning disable CA1716 // Preserve upstream public parameter names for callers using named arguments.
public interface ISqlModelElementReference : ISqlModelElement
{
public T GetMetadataProperty<T>(ModelPropertyClass property);
}
#pragma warning restore CA1716
4 changes: 2 additions & 2 deletions src/Core/DacFxStrongTypedCore.161/Interfaces.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//<copyright company="Microsoft">
//
// The MIT License (MIT)
Expand Down Expand Up @@ -22116,4 +22116,4 @@ String Expression
get;
}
}
}
}
Loading
Loading