C#C
C#4y ago
15 replies
Elio

❔ Entity Framwork SQLite Add

Hello, i've a little problem there. I'm trying to add something new in my database but i do not understand why it works in the case 1 and not in the case 2.
case 1 :
i add a new material to the database passing only the name and MaterialTypeId
new Material(_viewmodel.Name, _viewmodel.MaterialType.Id)

case 2:
i add a new material to the database passing the name and MaterialType but there it show me the error SQL error 19 Unique Id failed
new Material(_viewmodel.Name, _viewmodel.MaterialType)

Have you any idea what am i doing wrond ?
image.png
image.png
Was this page helpful?