-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Metadata: Configuring class as EntityType & later as owned entity type explicitly should throw #9148
Comments
Since throwing post 2.0 would be a breaking change, and this doesn't meet the bar to go into 2.0, could we instead copy facets over to the owned type or something like that? @AndriySvyryd? |
@ajcvickers Wouldn't that be a breaking change too? |
Yes, but maybe an acceptable one. 😸 |
Then it would become similar to |
I am not convinced that going in that direction would be a bad thing in the long term. Besides the decision we made for 2.0 (and the obvious benefits of forking the two APIs at the root so that Intellisense can better reflect the distinct capabilities of owned entity types vs. non-owned entity types) they are conceptually all entity types in EF Core. I am starting to suspect that negating that is detrimental to the usability of the API.
Feature request? |
Discussed in triage and decided to make it throw in the 2.1-preview1 and gather feedback as to whether this is too breaking. |
Well... now that you mention it.... I just hit this scenario whereby I have a stand alone Basically when an order is created, I could "snapshot" the customer details at that point in time and save them off on the particular order. By the sounds of things, this scenario is not supported. It doesn't throw.. but things get into a weird state? |
Marking this for re-triage. It turns out that a later change in 2.1 reverted this behavior, so it currently doesn't throw in this case. |
We will re-visit this in 3.0 since it is too late to do anything for 2.1. |
@nphmuller Unfortunately, 2.2 is locked down now for all but ship-stoppers. Also, this change has the potential to break some incorrectly configured but working applications, so we are targeting 3.0 since changing the behavior here could be a breaking change for those applications. |
@ajcvickers Makes sense, especially if it's breaking. Thanks! |
In above model
BlogDetails
has been configured as entity type first and then used as owned entity type. At present it works and creates the own entity type. It should throw exception because it is conflict in Explicit configuration source (which is what our behavior is for most other fluent APIs).Also if this does not throw (and silently remove entity type and add owned entity type) then any facet configuration done on entity types are lost which may seem confusing to user since user may understand
.EntityType<>
as a replacement of.ComplexType<>
may be.found while investigating issue #9144
The text was updated successfully, but these errors were encountered: