修改官方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.Schema");
|
||||
usings.Add("Microsoft.EntityFrameworkCore");
|
||||
usings.Add("IRaCIS.Core.Domain.Models");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(NamespaceHint))
|
||||
|
@ -62,11 +63,14 @@ namespace <#= NamespaceHint #>;
|
|||
}
|
||||
}
|
||||
#>
|
||||
public partial class <#= EntityType.Name #>
|
||||
public partial class <#= EntityType.Name #>: BaseFullAuditEntity
|
||||
{
|
||||
<#
|
||||
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))
|
||||
{
|
||||
if (!excludedColumns.Contains(property.Name))
|
||||
{
|
||||
if (!firstProperty)
|
||||
{
|
||||
|
@ -101,6 +105,7 @@ public partial class <#= EntityType.Name #>
|
|||
<#
|
||||
firstProperty = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var navigation in EntityType.GetNavigations())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue