.eax
❔ EF Core many-to-many migration problems
I added a new entity
VesselTransfer
and added two one-to-many relationship to the Vessel
entity, and added the configuration as shown in the code below to OnModelCreating
.
No problems with creating the migration and applying it to the DB, but now I'm getting this error during runtime Unable to determine the relationship represented by navigation 'Team.Persons' of type 'ICollection<Person>'.
. On a entity and relationship that has no changes, and I'm getting some form of this exception on whatever query I run. The error has different entities and relationships depending on the query.
I'm a bit of a loss on what is wrong as nothing seems wrong from the configurations.
4 replies
Have to call .ToList() on DbSets for .First() or .Single() to work. Sqlite
I have a simple dependency on a database, the schema contains 2 entities and I'm having some simple problems with making it work. I have to call
ToList
on the DbSets of the entities to make Single/First match elements. Anyone got any idea on whats wrong?
I add the context in Program.cs like this:
Context looks like this:
And I use it in a service like this:
7 replies