PowerDesigner 生成C#實體模版代碼


操作步驟見:  https://blog.csdn.net/da454122373/article/details/54346217

最后的template 模版代碼如下: 

.if (%isValidAttribute%)

///<summary>
[%comment%\n]\
///</summary>
[%customAttributes%\n]\
.if (%Multiple% == false) and (%isIndexer% == false)
[%visibility% ][%flags% ]%dataType% %Code%[ = %InitialValue%]{get;set;}
.else
[%visibility% ][%flags% ]%dataType%[%arraySize%] %Code%[ = %InitialValue%]{get;set;}
.endif
.endif

 

如果需要增加命名空間,在 classifier/Templates/sourceBody中修改如下:紅色字體是你需要的命名空間

.// only toplevel classes are generated
.if (%ContainerClassifier% == null)
.// header and usings
[\
%usings%\n
]\
.// class/interface definition (global namespace)
.ifnot (%Package.namespace%)
namespace Tiandi.Web.Authority.Model
{
%definition%
}
.else
[\
%Package.comment%
]\
[\
%Package.customAttributes%
]\
namespace %Package.namespace%
{
%definition%
}
.endif
.endif

 

 效果如下,簡單的一個結構

圖片中注釋多了 三條斜杠,之前多加的,圖片不換了

 

記錄以便后期需要


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM