Paul Gielens:ThoughtsService

another Endpoint to my thoughts

News

Syndication

Ads


Favorites

Projects

Autoincrement primary key in EDM

I must be overlooking something.

The ID field in my SQL Server database is configured to autoincrement through setting the Identity seed and Identity increment properties. For some reason the generated code allows the end user of the conceptual EDM model to set the ID property since it’s public. I would expect the setter to be at least private.

Posted: May 26 2008, 05:16 PM by p.gielens | with 2 comment(s)
Filed under: ,

Comments

FransBouma said:

Perhaps it's settable because you then can set the PK value of a new instance with the value of the entity you want to fetch into that object ? (not sure, havent looked at how EF fetches single entities in detail)

# May 27, 2008 3:25 AM

Paul Gielens said:

Thanks Frans, I'll dig further.

# May 28, 2008 1:15 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)