2017-01-18 85 views
0

使用EntityFramework Reverse POCO Generator v2.26.0,我無法找到在哪裏更改.tt以在生成POCO時停止列重命名。我懷疑這是在UpdateColumn,我已經更新只是單行:如何阻止EntityFramework Reverse POCO Generator重命名列?

UpdateColumn = (Column column, Table table) => column; 

但仍列得到來自如改名「Batch_ID」爲「BatchId」。

不停止列重命名,我得到的錯誤:

The data reader is incompatible with the specified 'DocumentExport.DataAccess.Databases.Batches.Batch'. A member of the type, 'BatchId', does not have a corresponding column in the data reader with the same name.

如何POCO生成過程中確實一站式列重命名?

回答

1

在database.tt,

UsePascalCase = false; // This will rename the generated C# tables & properties to use PascalCase. If false table & property names will be left alone. 

雖然這實現抑制列名,這也影響了表名和其他可能的事情。