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,
- Right-click model1.context. TT and click Run custom tool.
- 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.