EF5 does not automatically update TT after saving the modified edmx table structure

Source: Internet
Author: User

I don't know if this is a bug. When you create an edmx file generated from the database, it will generate all TT files correctly, but when you update the table structure from the database, he cannot correctly update the TT file. Taking model1.edmx as an example, expand model1.edmx in the solution,

  1. Right-click model1.context. TT and click Run custom tool.
  2. Right-click model1.tt and click Run custom volunteer. After these two steps, the file will be generated correctly according to the edmx structure.

You can also choose to delete model1.tt in step 1, right-click the edmx designer, and choose add.CodeGenerate items, select data --> EF 5. xdbcontext generator, and get the same name as edmx.

However, I recommend the first method.

Of course, EF5 has not abandoned EF4 designer. CS, you can also set model1.context. delete all TT and model1.tt, right-click the edmx designer and choose "properties"> "Code Generation Policy". The default policy is none. You can change it to the default one, and then save it with crtl + S, you will see him in designer. the Code seen in EF4 is generated in CS, and the entity classes are all in it.

The above are the first issues with EF5, and some problems will be recorded later.

2012-12-03 continued: After the upgrade to vs2012sp1, Microsoft fixed this bug. The TT file will be updated when the edmx table is updated or deleted.

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.