Closed ExusAltimus closed 3 years ago
This is a battle hardened implementation:
@ErikEJ If XML comments are enabled in EF Core 5.0, then I having them in my tool seems redundant. How does one enable generation of comments using the dotnet-ef CLI? They don't seem to be enabled by default.
@tonysneed XML comments are generated in EF Core 5! https://github.com/dotnet/efcore/blob/release/5.0/src/EFCore.Design/Scaffolding/Internal/CSharpEntityTypeGenerator.cs#L261 - they are generated by default in EF Core 6! https://github.com/dotnet/efcore/blob/main/src/EFCore.Design/Scaffolding/Internal/CSharpEntityTypeGenerator.cs#L264
How do you enable comments in EF Core 5? How do you disable them in EF Core 6? Is there a CLI parameter?
Magic!
No, I override the linked class and use that overridden class with my EF Core 5 scaffolding tool.
There is no option to turn it off.
Describe the bug If there is a new line character in the extended properties of a column / table, the default .hbs / CSharpEntityTypeGenerator doesn't account for this and leaves the generated models with syntax errors due to the new line not being commented out.
Expected behavior Split the string into lines and loop through each commenting the line out
To Reproduce Have an extended property with a newline character
Screenshots