| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <#@ template language="C#" #>
- <#@ assembly name="System.Core" #>
- <#@ import namespace="System.Linq" #>
- <#@ import namespace="System.Text" #>
- <#@ import namespace="System.Collections.Generic" #>
- using System;
- using Abp.AutoMapper;
- using System.ComponentModel.DataAnnotations;
- using IwbZero.AppServiceBase;
- namespace <#=Model.ApplicationNamespace#>.Dto
- {
- <#
- if(!string.IsNullOrEmpty(Model.HtmlPageTitle)){
- #>
- /// <summary>
- /// <#=Model.HtmlPageTitle#>
- /// </summary>
- <# }
- #> [AutoMapTo(typeof(<#=Model.ClassName#>))]
- <#if(Model.IdType=="string"){
- #>
- public class <#=Model.FileName#>CreateDto:IwbEntityDto
- <# }else{
- #>
- public class <#=Model.FileName#>CreateDto:IwbEntityDto<<#=Model.IdType#>>
- <#}
- #>
- {
-
- <#
- foreach (var item in Model.Columns)
- {
- if(!item.IsGenreated) continue;
-
- if(!string.IsNullOrEmpty(item.Comment)){
- #> /// <summary>
- /// <#=item.Comment#>
- /// </summary>
- <# }
- if (item.IsRequired)
- {
- #> [Required]
- <# }
- var maxLength="";
- if (item.IsVarchar && !string.IsNullOrEmpty(item.MaxLength))
- {
- maxLength=item.MaxLength.StartsWith(".")?Model.ClassName+item.MaxLength:item.MaxLength;
- }
- if(!string.IsNullOrEmpty(maxLength))
- {
- #> [StringLength(<#=maxLength#>)]
- <# }
- #> public <#=item.AttrType#> <#=item.ColumnName#> { get; set; }
- <#
- }
- #>
- }
- }
|