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