修改官方t4模板,适配我们自己的程序
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
c7e80401e1
commit
564477b728
|
@ -35,6 +35,7 @@
|
||||||
usings.Add("System.ComponentModel.DataAnnotations");
|
usings.Add("System.ComponentModel.DataAnnotations");
|
||||||
usings.Add("System.ComponentModel.DataAnnotations.Schema");
|
usings.Add("System.ComponentModel.DataAnnotations.Schema");
|
||||||
usings.Add("Microsoft.EntityFrameworkCore");
|
usings.Add("Microsoft.EntityFrameworkCore");
|
||||||
|
usings.Add("IRaCIS.Core.Domain.Models");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(NamespaceHint))
|
if (!string.IsNullOrEmpty(NamespaceHint))
|
||||||
|
@ -62,12 +63,15 @@ namespace <#= NamespaceHint #>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#>
|
#>
|
||||||
public partial class <#= EntityType.Name #>
|
public partial class <#= EntityType.Name #>: BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
<#
|
<#
|
||||||
var firstProperty = true;
|
var firstProperty = true;
|
||||||
|
var excludedColumns = new[] { "CreateUserId", "Id", "UpdateUserId", "CreateTime", "UpdateTime", "DeleteUserId", "IsDeleted", "DeletedTime" };
|
||||||
foreach (var property in EntityType.GetProperties().OrderBy(p => p.GetColumnOrder() ?? -1))
|
foreach (var property in EntityType.GetProperties().OrderBy(p => p.GetColumnOrder() ?? -1))
|
||||||
{
|
{
|
||||||
|
if (!excludedColumns.Contains(property.Name))
|
||||||
|
{
|
||||||
if (!firstProperty)
|
if (!firstProperty)
|
||||||
{
|
{
|
||||||
WriteLine("");
|
WriteLine("");
|
||||||
|
@ -100,6 +104,7 @@ public partial class <#= EntityType.Name #>
|
||||||
public <#= code.Reference(property.ClrType) #><#= needsNullable ? "?" : "" #> <#= property.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
|
public <#= code.Reference(property.ClrType) #><#= needsNullable ? "?" : "" #> <#= property.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
|
||||||
<#
|
<#
|
||||||
firstProperty = false;
|
firstProperty = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var navigation in EntityType.GetNavigations())
|
foreach (var navigation in EntityType.GetNavigations())
|
||||||
|
|
Loading…
Reference in New Issue