Entity Framework: Define a string computed Primary Key column in Data Annotations
Hello all, I am looking into Entity Framework for my main API project, where I am currently still doing the structure of my database.
In order to make some data a bit more readable. I have decided to create a generate string primary key for this table.
The Composite Key is defined by three variables, technically it only has to have two variables but I am picking three to make sure the variables itself is really unique.
And it has to be structured like this:
DexID-GRID-BreedableState(first letter)
So let me give one example I have one row with the following: DEXID, GRID, BreedableState 25, 2, false
The new composite Key has to be established like this then as an example:
25-2-f
The thing is while I know you can set it a computed value like this in Entity Framework: