C
C#•3mo ago
VillagerKing

MVC project. Can't get my create Book to work.

I am working on a basic MVC project and i am having trouble getting my create working for creating a book.
Got all the files i think relate to my problem. When i attempt to post i get a status 200 return Any ideas? Attached are the files i think are causing the issue.
2 Replies
Angius
Angius•3mo ago
ViewBag 💀 It probably doesn't work, because it expects a Book. As in, the whole book, ID and all Your form does not send that information — good So... you need to use a DTO class that will have only the properties expected of the form Then construct the book proper based on that And save it in the db
VillagerKing
VillagerKingOP•3mo ago
Bruh you right Thanks man

Did you find this page helpful?