Entity Framework Core - Composite Key

Asked

Viewed 156 times

1

Until version 1.0 of EF Core I was having problems doing UPDATE on a database record that contained a composite key. If I tried to change the ID value of one of the compound key fields, it was not allowed and gave error. I was advised in the forums that it was an EF Core problem that had not yet been fixed. So, all my tables were created with only one primary key and I let the application treat it... but I confess that it bothers me. Does anyone know if this has been fixed?

Thank you :)

1 answer

0


Primary key value change is a practice that is not recommended by the Entity Framework.

When it comes to database architecture changing the registry identification is a misconception. Correct is to delete the record and insert a new one with a new identification.

That being said, from the research I did, apparently EF Core does not consider this a problem to be fixed so it may never be implemented.

Well, as I am interested in the subject, I am answering you here more to open a discussion about.

Hugs.

  • 1

    Got it... Thanks for the help @Thiago Araújo!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.