Skip to content
Advertisement

Entity Framework Core 2.1 trouble with relationships

I’m trying to convert the following sql query to entity framework but running into problems with what appears columns not joining to tables.

This is what i have so far

DB Context:

Column Class:

Table class:

Main:

Code runs fine, but when inspecting the table instances all the column instances are null. I have a feeling it has something to do with the relationship between table and column but after going over the docs for relationships for efcore2.1 i cant work out what I’m doing wrong.

Any help would be appreciated.

Update: Updated code with additional keys and related data loading.

Advertisement

Answer

Try this:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement