⇤ ← Revision 1 as of 2022-02-20 23:39:43
Size: 710
Comment:
|
Size: 709
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
{{{#!hightlight sql | {{{#!highlight sql |
Console Database Example using EF Core 6
Major Caveat: EntityFrameworkCore does not support a simple many-to-many relationship (as of 2/20/2022) nor does it do what you would expect and include the intersection table. Instead it creates code that causes a runtime error.
Fix: The fix is weirder than you might expect. You must include the intersection table on your own. But you might ask, can't I make the entity framework core six include the table for me. Why yes, YES YOU CAN. But it will take a bit of changing of your database. For me this required the altering of a single table in our database.
Toggle line numbers
1 ALTER TABLE teaches
2 ADD teacher_credit NUMERIC(3,12);