Hi @Robert Pettis ,
You can refer to the following sample:
- Create two classes: Product and ProductViewModel class:
- Add the DbSet to the ApplicationDbContext and enable migration to generate the Product table.
- In the Controller Post method, based on the view model to create the Product instance and then insert it into the database.
- In the Create view page, remember to add the enctype attribute.
You can view the source code from here: 228329-sourcecode.txt
Then the output is like this:
Finally, here are some resources you can refer to them:
ASP.NET Core MVC with EF Core - tutorial series
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion