Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to Add a Primary Key to the Products Model

$
0
0

I am new to MVC, and I'm studying the MVC Core 2 book by Freeman (see below).

As I go through the code to build a modest product inventory display, I'm at the point where

I need to create my first database migration. So at the command prompt, I typed:

> dotnet ef migrations add Initial

The error message says my products class requires a primary key! How do I provide it? Freeman

does not cover that in the book (that I can find).

Thanks for any help on this!

Corey

cf. Pro ASP.NET Core MVC 2, by Adam Freeman, APress, 7th Edition, 2017


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>