There are ways, in the DBContext, to make the database own the ids. But EF requires consumers to specify if the DB or the client owns the keys; no middle ground. This is the right place to have code that handles optional keys, and it is simple. Anything else would be overkill, I think.