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

Suggestion: add attribute to make type keyless #19246

Closed
LostAsk opened this issue Dec 9, 2019 · 5 comments · Fixed by #20011
Closed

Suggestion: add attribute to make type keyless #19246

LostAsk opened this issue Dec 9, 2019 · 5 comments · Fixed by #20011
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-enhancement
Milestone

Comments

@LostAsk
Copy link

LostAsk commented Dec 9, 2019

Now ViewModel(ReonlyModel) It can only be set through the fluent API.
I want to attribute that the entity is read-only through the feature.

To avoid having to call HasNoKey.

@ajcvickers
Copy link
Contributor

Note for triage: specific case of #10864

@ajcvickers ajcvickers added this to the Backlog milestone Dec 9, 2019
@ajcvickers ajcvickers changed the title Suggestion: add hasnokeyattribute to the entity Suggestion: add attribute to make type keyless Jan 13, 2020
@Joehannus
Copy link

Joehannus commented Jan 17, 2020

When will this be implemented? Right now we are using DBQuery in our Azure based solution. And as I mentioned in #19509, we use .Net Framework as well as .Net Core - which does not allow us to use the Fluent API. In stead we use data annotations in our entity classes. Because DBQuery is obsolete in EF Core this even has as a consequence that we will it will be very difficult to from .Net Core 2.x to 3.x, if not almost impossible.

@ajcvickers
Copy link
Contributor

@Joehannus This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 5.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

We can continue the conversation on #19509 but I still do not understand why you can't just the model building API.

@smitpatel
Copy link
Contributor

@AndriySvyryd - Pick a name. 😉

@AndriySvyryd
Copy link
Member

[Keyless]

@smitpatel smitpatel self-assigned this Feb 19, 2020
smitpatel added a commit that referenced this issue Feb 21, 2020
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 modified the milestones: Backlog, 5.0.0 Feb 21, 2020
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Feb 21, 2020
smitpatel added a commit that referenced this issue Feb 21, 2020
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
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview1 Mar 13, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview1, 5.0.0 Nov 7, 2020
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-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants