-
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
The type 'Address' cannot be marked as owned because a non-owned entity type with the same name already exists. #21763
Comments
modelBuilder.Entity<Address>(x => x.Property(y => y.GeoLocation).HasJsonConversion()); This line configures |
Thanks that makes sense. It seems a bit verbose though that I have to duplicate the setup for each implementation of the address. I can see the benefit of being able to do it individually though. Perhaps it's a feature request? Could the decision around configuring the entity as regular/owned be deferred until a later point? i.e. when using .OwnsOne() in my case thereby allowing configuration of properties on the Type for every usage? |
@AndriySvyryd Are we using #6787 to track configuration of all owned-type instances in one place? |
@lenniebriscoe Closing this as a duplication of #6787 which covers your request. |
@ajcvickers many thanks. It's listed as "punted-for-2.0" and we are on 3.1\5 unless I misunderstand? Does that mean it's not priority right now ? |
@lenniebriscoe This is something we definitely plan to do--I would be surprised if it doesn't make it into EF Core 6.0. |
Steps to reproduce
I have the following model I am creating in EFCore3.1 using the CosmosDb Provider. On trying to run the project and accessing the database for the first time I receive an error:
In the DbContext I have:
However on the line:
x.OwnsOne(x => x.Site).OwnsOne(x => x.Address);
I get the error:
Please can you advise how I can create a similar json document to the following?:
Further technical details
EF Core version: 3.1.6
Database provider: Microsoft.EntityFrameworkCore.Cosmos
Target framework: netcoreapp3.1
Operating system: Windows 10
IDE: Visual Studio 2019 Enterprise 16.6.3
The text was updated successfully, but these errors were encountered: