Accompanied by. the official version of net2010 is released ,. net4.0, ef4.0, and a series of xx4.0 releases the official version. Unfortunately, ADO is in the official version of ef4.0. the entity classes generated by the net self-Tracking Entity Generator template still do not implement the built-in rejectchanges () method.
How can we make the generated object class have the rejectchanges () method? After exploration, we found a solution.
ADO. the files used by the net self-Tracking Entity Generator template are located in the X: \ Program Files \ Microsoft Visual Studio 10.0 \ common7 \ ide \ itemtemplatescache \ CSHARP \ code \ 1033 \ adonetentitydatamodelt4selftrackingcodegencsharp, modify
Csharpselftracking. types. tt enables the generated class to be inherited from the class that supports the rejectchanges () method.
Package related files as follows:
Http://files.cnblogs.com/wiseant/Model.Types.rar
Http://files.cnblogs.com/wiseant/AdoNetEntityDataModelT4SelfTrackingCodeGenCSharp.zip.rar
Vs2010 Simplified Chinese official version needs to overwrite the file to the X: \ Program Files \ Microsoft Visual Studio 10.0 \ common7 \ ide \ itemtemplatescache \ CSHARP \ code \ 2052 \ adonetentitydatamodelt4selftrackingcodegencsharp.zip folder, replace the original file.