-
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
Use KeyAtrribute for scaffolding to support OData #15677
Comments
Notes from triage: the discussion in #11003 on how A couple of concrete things that come out of this:
Note that we should also make sure that we don't log a warning the properties have |
This would be really nice to have, also for EF Core Power Tools - is this up for grabs, of should I overide the service as suggested here in the meantime: |
@ErikEJ I think it is ok if you want to go ahead with a PR. @ajcvickers, any concerns? |
As I understand this, the goal is to always scaffold Key attribute for all involved properties when DataAnnotations are requested. Or always? |
My understanding is that KeyAtrribute being used will still depend on whether you ask for DataAnnotations to be used, but no longer on whether the key is composite. And in the latter case we will still generate the HasKey method so that the key mapping works for EF Core (because we need the key member ordering information). The relevant comment is #11003 (comment). |
@ErikEJ Agree with Diego's last comment. Also, almost any issue that isn't closed is something that we would take a PR for--it doesn't have to have |
when DataAnnotations have been requested. fixes dotnet#15677
Always scaffold [Key] attribute on all involved properties when DataAnnotations have been requested. fixes #15677
OData requires
[Key]
attribute for entities where the primary key property name is notId
(it can't use.HasKey()
info in FluentAPI)Please allow scaffolding to generate Key Attributes if the column is name is not
Id
or the key is different than theId
property.The text was updated successfully, but these errors were encountered: