-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design: Modernize generated C# #14545
Comments
I think that with #10347 we'd be generating classes that use C# 8 nullability to express requiredness in properties... So I think C# 8 should be fine? |
Default is currently "8.0 (beta)" |
Consider:
|
See nullability-related notes here: #10347 (comment) |
I think we can safely assume C# 8.0 as our language minimum version in EF Core 3.0. This is the default for projects targeting .NET Standard 2.1 and .NET Core 3.0. |
Areas I'd like to improve:
|
There's #15520 for tracking NRT scaffolding, should we close that and track everything there? Note that for NRTs specifically there's the additional opt-in flag so it's an additional thing to do. |
I think it goes beyond DbContext scaffolding too—model snapshots and migrations may also have to be updated when NRT is enabled in the project |
But maybe not as much as I think since NRT is more about member definitions than types... |
Yeah, could be... |
For example, will these work as-is in a project that enables NRTs? DbContext
Migration
ModelSnapshot
|
Would it make sense to reopen #25223? I feel like this issue is much broader than that one 🙂 |
We like broad issues. We consider everything together when working on it. If, for whatever reason, it doesn't all fit into one release, we prioritize the important parts and file separate issues for any remaining items. |
Okay 🙂 I'd like to post my request here, then, since I don't think it's been mentioned in this thread: When EF Core starts modernizing its generated C# code, I'd love for it to respect our For example, |
There's been similar requests for ensuring code generated by templates does this too. In VS new files from templates are formatted according to current .editorconfig preferences. In the case of the CLI and tools like |
Oh that should actually be relatively simple if roslyn was made into it's own shared framework (then it could use it without problems). Pros:
Cons:
|
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing. Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing. Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing. Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing. Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
This is probably dotnet/templating#5505. |
Can we drop the BOM 💣now as well? |
This is related to #11744, but more general. We should investigate what the minimum version of C# we need to support in EF Core 3.0 is and modernize our generated code. I'm pretty sure there are a few expression bodied methods I'd like add...
The text was updated successfully, but these errors were encountered: