0

I am looking at entity framework and trying learn more about it. So have created a simple project to play with.

I found out that I can't add a table if it does not have a primary key. Reading some posts on here and other places I think that is correct. It is apparently to allow EF to do deletions and updates etc. If I have a project where there will be no deletions or updates, just select queries I'm guessing it doesn't matter what column I make as a primary key? I understand most tables should have a primary this is just a question out of curiosity.

Also can EF handle a primary key on multiple columns, I assume so?

mHelpMe
  • 6,336
  • 24
  • 75
  • 150

1 Answers1

1

Although you application does not require deletions or updates, son or later you will need a primary key. If you set a good primary key (here you have a good guide for this), the task of programming will be much easier. And yes, EF can handle primary key on multiple columns.

FractalCode
  • 360
  • 1
  • 4