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

Consider allowing reverse engineering to generate CLR property defaults based on column defaults #9632

Open
Tracked by #22948
ajcvickers opened this issue Aug 30, 2017 · 1 comment

Comments

@ajcvickers
Copy link
Contributor

See #9617. For example, if a column State has a default of "WA", then the entity type would be generated as:

public partial class Customer
{
    public string State { get; set; } = "WA";
}

Consider also parsing common SQL defaults, like getdate(), and generating a CLR equivalent.

@ajcvickers
Copy link
Contributor Author

Triage: We will consider doing this in the future, but:

  • Probably in a limited form that doesn't require any complex parsing of SQL
    • In a way that doesn't change the semantics of the default--for example, we wouldn't make getdate() be calculated on the client rather than the server
    • This means probably just simple literals
  • It will likely require some form of templating or other customization mechanism for code generation as a prerequisite so that the defaults can be used selectively where wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants