© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
18 replies
pyrodistic

Entity Framework One-To-One [Answered]

Code at: https://paste.mod.gg/rccwzntafwoj/0

When attempting to change the database I'm getting:

The dependent side could not be determined for the one-to-one relationship between 'Room.Vet' and 'Vet.Room'. To identify the dependent side of the relationship, configure the foreign key property. If these navigations should not be part of the same relationship, configure them independently via separate method chains in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details.

OR

The property 'Room.Vet' is of type 'Vet' which is not supported by the current database provider. Either change the property CLR type, or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

I wanted to be able to create a Room that can have 0 or 1 Vets, and create a Vet that has 0 or 1 Rooms.

What am I doing incorrectly?

Thanks in advance.
BlazeBin - rccwzntafwoj
A tool for sharing your source code with the world!
Relationships - EF Core
How to configure relationships between entity types when using Entity Framework Core
Relationships - EF Core
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Entity Framework Core DB issues [Answered]
C#CC# / help
4y ago
Entity framework
C#CC# / help
14mo ago
❔ Entity Framework
C#CC# / help
3y ago
❔ Entity Framework
C#CC# / help
4y ago