Skip to content
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

Scaffolding column with ValueGenerated.OnUpdate generates invalid C# code #18579

Closed
lauxjpn opened this issue Oct 24, 2019 · 1 comment · Fixed by #18619
Closed

Scaffolding column with ValueGenerated.OnUpdate generates invalid C# code #18579

lauxjpn opened this issue Oct 24, 2019 · 1 comment · Fixed by #18619
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@lauxjpn
Copy link
Contributor

lauxjpn commented Oct 24, 2019

See PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#877 for an example (issue 2).

The issue is, that the following switch is missing the handling of ValueGenerated.OnUpdate:

https://github.com/aspnet/EntityFrameworkCore/blob/27c8d56284a641ef0836972ced08db8f7433674d/src/EFCore.Design/Scaffolding/Internal/CSharpDbContextGenerator.cs#L701-L730

It will therefore generate entity.Property(e => e.MyProperty).() for properties with ValueGenerated.OnUpdate.

Is that an oversight or a deliberate choice?

@smitpatel
Copy link
Contributor

It's a bug. SHould generate correct methodName for all the enum values and throw for default case.

@ajcvickers ajcvickers added this to the 3.1.0 milestone Oct 25, 2019
roji added a commit that referenced this issue Oct 28, 2019
roji added a commit that referenced this issue Oct 28, 2019
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 28, 2019
roji added a commit that referenced this issue Oct 28, 2019
roji added a commit that referenced this issue Oct 28, 2019
roji added a commit that referenced this issue Oct 29, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0-preview3, 3.1.0 Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants