Storegeneratedpattern property in ADO. NET Entity Model Designer sets cdsl annotation but not SSDL

Source: Internet
Author: User

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!

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.