diff --git a/IRaCIS.Core.Test/CodeTemplates/EFCore/EntityType.t4 b/IRaCIS.Core.Test/CodeTemplates/EFCore/EntityType.t4 index 260898361..83ce23cca 100644 --- a/IRaCIS.Core.Test/CodeTemplates/EFCore/EntityType.t4 +++ b/IRaCIS.Core.Test/CodeTemplates/EFCore/EntityType.t4 @@ -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,12 +63,15 @@ 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) { WriteLine(""); @@ -100,6 +104,7 @@ public partial class <#= EntityType.Name #> public <#= code.Reference(property.ClrType) #><#= needsNullable ? "?" : "" #> <#= property.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #> <# firstProperty = false; + } } foreach (var navigation in EntityType.GetNavigations())