Home > Software design >  How do I add and delete data in the crosstab later using Ef Core 6?
How do I add and delete data in the crosstab later using Ef Core 6?

Time:05-17

I have PostgreSQL database, and three tables in that. These are;

Categories

UploadedFiles

CategoryUploadedFiles (This is my cross table)

When I import this tables to my project with DbFirst method it doesn't create the cross table. (CategoryUploadedFiles) I need to add and remove manually in my cross table but I can't because it doesnt't created.

How can I do it?

database schema : https://prnt.sc/PXPMgPAvbw_j

dbcontext : https://prnt.sc/vNyU4ns-TgI3

category entity : https://prnt.sc/8JU3nixmjMC1

file entity : https://prnt.sc/w726YDa1lYhm

Entity folder : https://prnt.sc/9b7gKaS_85Iv

Code : https://prnt.sc/29Pdy_flT_Ry

CodePudding user response:

You should declare a new class named CategoryUploadedFile and add this class to your DBContext.

CodePudding user response:

Added primary key to my cross table. (Id) So the entity object was imported into the project.

Thank you written answer users to my question.

  • Related