Using the vs2010 ADO. NET Entity model designer for. edmx file to set the "storegeneratedpattern" property of a database column (a feature not available at all in the ADO. NET Entity Model Designer of vs2008 SP1-thanks for exposing that property in the designer, but right now it's dangerous !) And associated entity property to "Identity" or "computed" only sets the "A: storedgeneratedpattern" attribute in the Entity property entry in the cdsl section of the file. it really shoshould also set the "storedgeneratedpattern" property on the corresponding database column entry in the SSDL, or the expected behavior will not occur in LINQ-to-entities code (properties connected to such columns will Not auto-populate after a savechanges is saved med on the entity context, and worse, invalid null or default values will be written to those database fields, overwriting what the database generated !).
RememberAlways manually add the "storedgeneratedpattern =" (whatever) "" to the SSDLManually editing the. edmx in XML editor ModeWhenever using (or instead of using, but then you have to add the corresponding annotation to the cdsl as well) the ADO. NET Entity Model Designer Property Window's "storedgeneratedpattern" property, until this bug in the designer has been fixed.
Failure to do so will result in code that does not function properly, and even can result in serious Database Value failed uption!