What’s the benefit of defining the primary key attribute as virtual in entity Framework?
AFAIK, virtual is used for lazy loading in navigation properties and for change tracking in other properties. But we don’t need any of the mentioned features in primary keys.
So, Is it any use to define primary keys virtual?
Change tracking proxies are created only if all non-navigation mapped properties are
virtual. MSDN: