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

Introduce KeylessAttribute #20011

Merged
merged 1 commit into from
Feb 21, 2020
Merged

Introduce KeylessAttribute #20011

merged 1 commit into from
Feb 21, 2020

Conversation

smitpatel
Copy link
Member

Resolves #19246
Also related #19964

  • Add KeylessAttribute in Abstractions packge
  • Add convention to detect KeylessAttribute and configure the entityType to be keyless
  • Scaffolding when using data annotations
    • Generate KeylessAttribute over entity class
    • Skip HasNoKey from fluent API configuration

Tests:

  • Add tests for OwnedAttribute
  • Add tests for KeylessAttribute
  • Add test for scaffolding to verify behavior with data annotations

Resolves #19246
Also related #19964

- Add KeylessAttribute in Abstractions packge
- Add convention to detect KeylessAttribute and configure the entityType to be keyless
- Scaffolding when using data annotations
  - Generate KeylessAttribute over entity class
  - Skip HasNoKey from fluent API configuration

Tests:
- Add tests for OwnedAttribute
- Add tests for KeylessAttribute
- Add test for scaffolding to verify behavior with data annotations
@smitpatel smitpatel merged commit 5c5d7c0 into master Feb 21, 2020
@smitpatel smitpatel deleted the smit/keyless branch February 21, 2020 02:22
@Joehannus
Copy link

In which version of EF Core is this introduced? Or which version will it be introduced, We're currently busy upgrading from .Net Core 2.2 to 3.1. And as we were using DbQuery and data annotations on our database classes in stead of a model builder syntax, we really need this.

@AndriySvyryd
Copy link
Member

@Joehannus 5.0.0-preview1

@Joehannus
Copy link

Why not in 3.1? We're currently upgrading to 3.1. And the removal of DbQuery is quite bothersome for us. We use data annotations in our EF classes, in stead of the model builder syntax. And I'd rather not have a mix of both. I will have to see whether I can introduce the model builder approach for the view entities only. We can't rewrite all our data annotations to model builder versions. That would have a big impact on our planning. But also because we have .net framework and Core EF projects. That would take a lot of time rewriting, but also regression testing.

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

Successfully merging this pull request may close these issues.

Suggestion: add attribute to make type keyless
3 participants