The value '' is invalid. for primary key in MVC
I'm practicing MVC with asp.net and building a simple todo app. I have my Model:
and MVC controller:
and my view _Form.cshtml:
When I try to run the program, the data is not written into my database and I also get the error
and MVC controller:
and my view _Form.cshtml:
When I try to run the program, the data is not written into my database and I also get the error
The value '' is invalid , when I run the program in debug, the error cause from Id value, from what I found on the internet, people that had this error only cause with other attribute, but not primary key as mine. So I'm frustrated right now, because it's primary key, so I cannot just make it nullable or assign a default value as the normal attribute.