16-IV-2019.

Nina: Hi Grbo, I have a question. Why is the pk overriden in table models? [Column("Bld_pk")]
public override int id ( get; set; )

Grbo: its overrideb because we are inheriting Entity class in our modals and its uses Id property as PK. So we are overriding it and using Column attribute to pointing it to bld_pk
and its not auto insert, I talked to Kees about it and it seems that they are using some stored procedure to create id but in our case we can query last id and increment it by 1 to add create new pk

Nina: Why can't we use the stored procedure to get the new pk? It's not always true that the next unused pk will be last + 1

Grbo: yes it is

Nina: Oh?
How so?
If Feds is using stored procedure and you're using last + 1, maybe you'll always get a new one, but Feds will run into trouble and overwrite the pk you used.

And this is not, by large, the only example of the Operation team knowing things better without actually looking into them nor talking with anyone about them. And even when they do talk, they still know better.


Mentions: Feds, Kees de Cock, Nevena Sredljević (Nina), Operation Zone53, Prasad Gorbeau (Grbo), in serbian