✅ Help understanding how to get foreign relation using Entity Framework core.
Hi,
I want to be able to join two tables to get all words in a category using entity framework core (whatever the latest version is).
I have a sqlite3 database with two tables, words and categories. This is their schema:
categories: name, id.
words: id, text, categoryid (foreign key), length.
In plain sql joining them would be easy, just something like (or with join/innerjoin)
when I try
I get this error.
This is the on model creating
these are the class models
6 Replies
I understand there's some kind of loop but I can't figure out where I've gone wrong.
I tried adding in the onconfiguring method
I am going to sleep. Its a problem for tomorrow me
Don't serialize database models
Problem solved
and don't use lazy loading, ever
so I need to make another model and return that instead?
a data transfer object
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
The answer was helpful, no need for a new thread. thank you