首页 > Windows开发 > 详细

PowerDesigner 生成C#实体模版代码

时间:2019-04-17 12:45:58      阅读:147      评论:0      收藏:0      [点我收藏+]
原文: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

 

 效果如下,简单的一个结构

技术分享图片

 

 

记录以便后期需要

PowerDesigner 生成C#实体模版代码

原文:https://www.cnblogs.com/lonelyxmas/p/10722620.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!