Entity Framework without primary key

Asked

Viewed 495 times

0

I have the following problem:

Every time I update the Diagram model of my project, it loses the reference of which field is the primary key, even I try the PK in the table in my Database. Does anyone have any idea what might be causing this ?

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • You are using EDMX?

  • That’s right, man

  • You can take a picture of your diagram showing some of the entities that are losing the primary key?

  • I put the images... If you notice in my diagram have the User code as key, but in my codebehind is not as key, there every time I have to put it as key

  • I know little of what the EDMX does alone, but my guess is the nomenclature that is out of his standard. The correct would be UsuarioId, and not UsuárioCodigo. My suggestion, in fact, would be to abandon the EDMX and use the text-only Models, less prone to errors.

1 answer

1


Browser other questions tagged

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