@@ -116,6 +116,8 @@ public interface IEfrpgTestDbContext : IDisposable
116116 DbSet < TblOrderError > TblOrderErrors { get ; set ; } // tblOrderErrors
117117 DbSet < TblOrderErrorsAb > TblOrderErrorsAbs { get ; set ; } // tblOrderErrorsAB_
118118 DbSet < TblOrderLine > TblOrderLines { get ; set ; } // tblOrderLines
119+ DbSet < TemporalDepartment > TemporalDepartments { get ; set ; } // TemporalDepartment
120+ DbSet < TemporalDepartmentHistory > TemporalDepartmentHistories { get ; set ; } // TemporalDepartmentHistory
119121 DbSet < ThisIsMemoryOptimised > ThisIsMemoryOptimiseds { get ; set ; } // ThisIsMemoryOptimised
120122 DbSet < Ticket > Tickets { get ; set ; } // Ticket
121123 DbSet < TimestampNotNull > TimestampNotNulls { get ; set ; } // TimestampNotNull
@@ -420,6 +422,8 @@ public class EfrpgTestDbContext : DbContext, IEfrpgTestDbContext
420422 public DbSet < TblOrderError > TblOrderErrors { get ; set ; } // tblOrderErrors
421423 public DbSet < TblOrderErrorsAb > TblOrderErrorsAbs { get ; set ; } // tblOrderErrorsAB_
422424 public DbSet < TblOrderLine > TblOrderLines { get ; set ; } // tblOrderLines
425+ public DbSet < TemporalDepartment > TemporalDepartments { get ; set ; } // TemporalDepartment
426+ public DbSet < TemporalDepartmentHistory > TemporalDepartmentHistories { get ; set ; } // TemporalDepartmentHistory
423427 public DbSet < ThisIsMemoryOptimised > ThisIsMemoryOptimiseds { get ; set ; } // ThisIsMemoryOptimised
424428 public DbSet < Ticket > Tickets { get ; set ; } // Ticket
425429 public DbSet < TimestampNotNull > TimestampNotNulls { get ; set ; } // TimestampNotNull
@@ -587,6 +591,8 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
587591 modelBuilder . Configurations . Add ( new TblOrderErrorConfiguration ( ) ) ;
588592 modelBuilder . Configurations . Add ( new TblOrderErrorsAbConfiguration ( ) ) ;
589593 modelBuilder . Configurations . Add ( new TblOrderLineConfiguration ( ) ) ;
594+ modelBuilder . Configurations . Add ( new TemporalDepartmentConfiguration ( ) ) ;
595+ modelBuilder . Configurations . Add ( new TemporalDepartmentHistoryConfiguration ( ) ) ;
590596 modelBuilder . Configurations . Add ( new ThisIsMemoryOptimisedConfiguration ( ) ) ;
591597 modelBuilder . Configurations . Add ( new TicketConfiguration ( ) ) ;
592598 modelBuilder . Configurations . Add ( new TimestampNotNullConfiguration ( ) ) ;
@@ -744,6 +750,20 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
744750 new IndexAnnotation ( new IndexAttribute ( "fki_ParentTableA_FK_Constraint" , 1 ) )
745751 ) ;
746752
753+ modelBuilder . Entity < TemporalDepartmentHistory > ( )
754+ . Property ( e => e . SysStartTime )
755+ . HasColumnAnnotation (
756+ IndexAnnotation . AnnotationName ,
757+ new IndexAnnotation ( new IndexAttribute ( "ix_TemporalDepartmentHistory" , 2 ) )
758+ ) ;
759+
760+ modelBuilder . Entity < TemporalDepartmentHistory > ( )
761+ . Property ( e => e . SysEndTime )
762+ . HasColumnAnnotation (
763+ IndexAnnotation . AnnotationName ,
764+ new IndexAnnotation ( new IndexAttribute ( "ix_TemporalDepartmentHistory" , 1 ) )
765+ ) ;
766+
747767 modelBuilder . Entity < WVN_Article > ( )
748768 . Property ( e => e . FkFactory )
749769 . HasColumnAnnotation (
@@ -856,6 +876,8 @@ public static DbModelBuilder CreateModel(DbModelBuilder modelBuilder, string sch
856876 modelBuilder . Configurations . Add ( new TblOrderErrorConfiguration ( schema ) ) ;
857877 modelBuilder . Configurations . Add ( new TblOrderErrorsAbConfiguration ( schema ) ) ;
858878 modelBuilder . Configurations . Add ( new TblOrderLineConfiguration ( schema ) ) ;
879+ modelBuilder . Configurations . Add ( new TemporalDepartmentConfiguration ( schema ) ) ;
880+ modelBuilder . Configurations . Add ( new TemporalDepartmentHistoryConfiguration ( schema ) ) ;
859881 modelBuilder . Configurations . Add ( new ThisIsMemoryOptimisedConfiguration ( schema ) ) ;
860882 modelBuilder . Configurations . Add ( new TicketConfiguration ( schema ) ) ;
861883 modelBuilder . Configurations . Add ( new TimestampNotNullConfiguration ( schema ) ) ;
@@ -2346,6 +2368,8 @@ public class FakeEfrpgTestDbContext : IEfrpgTestDbContext
23462368 public DbSet < TblOrderError > TblOrderErrors { get ; set ; } // tblOrderErrors
23472369 public DbSet < TblOrderErrorsAb > TblOrderErrorsAbs { get ; set ; } // tblOrderErrorsAB_
23482370 public DbSet < TblOrderLine > TblOrderLines { get ; set ; } // tblOrderLines
2371+ public DbSet < TemporalDepartment > TemporalDepartments { get ; set ; } // TemporalDepartment
2372+ public DbSet < TemporalDepartmentHistory > TemporalDepartmentHistories { get ; set ; } // TemporalDepartmentHistory
23492373 public DbSet < ThisIsMemoryOptimised > ThisIsMemoryOptimiseds { get ; set ; } // ThisIsMemoryOptimised
23502374 public DbSet < Ticket > Tickets { get ; set ; } // Ticket
23512375 public DbSet < TimestampNotNull > TimestampNotNulls { get ; set ; } // TimestampNotNull
@@ -2453,6 +2477,8 @@ public FakeEfrpgTestDbContext()
24532477 TblOrderErrors = new FakeDbSet < TblOrderError > ( "Id" ) ;
24542478 TblOrderErrorsAbs = new FakeDbSet < TblOrderErrorsAb > ( "Id" ) ;
24552479 TblOrderLines = new FakeDbSet < TblOrderLine > ( "Id" ) ;
2480+ TemporalDepartments = new FakeDbSet < TemporalDepartment > ( "DeptId" ) ;
2481+ TemporalDepartmentHistories = new FakeDbSet < TemporalDepartmentHistory > ( "DeptId" , "DeptName" , "SysStartTime" , "SysEndTime" ) ;
24562482 ThisIsMemoryOptimiseds = new FakeDbSet < ThisIsMemoryOptimised > ( "Id" ) ;
24572483 Tickets = new FakeDbSet < Ticket > ( "Id" ) ;
24582484 TimestampNotNulls = new FakeDbSet < TimestampNotNull > ( "Id" ) ;
@@ -4841,6 +4867,28 @@ public class TblOrderLine
48414867 public virtual TblOrder TblOrder { get ; set ; } // tblOrdersFK
48424868 }
48434869
4870+ // TemporalDepartment
4871+ public class TemporalDepartment
4872+ {
4873+ public int DeptId { get ; set ; } // DeptID (Primary key)
4874+ public string DeptName { get ; set ; } // DeptName (length: 50)
4875+ public int ? ManagerId { get ; set ; } // ManagerID
4876+ public int ? ParentDeptId { get ; set ; } // ParentDeptID
4877+ public DateTime SysStartTime { get ; set ; } // SysStartTime
4878+ public DateTime SysEndTime { get ; set ; } // SysEndTime
4879+ }
4880+
4881+ // TemporalDepartmentHistory
4882+ public class TemporalDepartmentHistory
4883+ {
4884+ public int DeptId { get ; set ; } // DeptID (Primary key)
4885+ public string DeptName { get ; set ; } // DeptName (Primary key) (length: 50)
4886+ public int ? ManagerId { get ; set ; } // ManagerID
4887+ public int ? ParentDeptId { get ; set ; } // ParentDeptID
4888+ public DateTime SysStartTime { get ; set ; } // SysStartTime (Primary key)
4889+ public DateTime SysEndTime { get ; set ; } // SysEndTime (Primary key)
4890+ }
4891+
48444892 // The table 'Test' is not usable by entity framework because it
48454893 // does not have a primary key. It is listed here for completeness.
48464894 // Test
@@ -6842,6 +6890,50 @@ public TblOrderLineConfiguration(string schema)
68426890 }
68436891 }
68446892
6893+ // TemporalDepartment
6894+ public class TemporalDepartmentConfiguration : EntityTypeConfiguration < TemporalDepartment >
6895+ {
6896+ public TemporalDepartmentConfiguration ( )
6897+ : this ( "dbo" )
6898+ {
6899+ }
6900+
6901+ public TemporalDepartmentConfiguration ( string schema )
6902+ {
6903+ ToTable ( "TemporalDepartment" , schema ) ;
6904+ HasKey ( x => x . DeptId ) ;
6905+
6906+ Property ( x => x . DeptId ) . HasColumnName ( @"DeptID" ) . HasColumnType ( "int" ) . IsRequired ( ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . None ) ;
6907+ Property ( x => x . DeptName ) . HasColumnName ( @"DeptName" ) . HasColumnType ( "varchar" ) . IsRequired ( ) . IsUnicode ( false ) . HasMaxLength ( 50 ) ;
6908+ Property ( x => x . ManagerId ) . HasColumnName ( @"ManagerID" ) . HasColumnType ( "int" ) . IsOptional ( ) ;
6909+ Property ( x => x . ParentDeptId ) . HasColumnName ( @"ParentDeptID" ) . HasColumnType ( "int" ) . IsOptional ( ) ;
6910+ Property ( x => x . SysStartTime ) . HasColumnName ( @"SysStartTime" ) . HasColumnType ( "datetime2" ) . IsRequired ( ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . Identity ) ;
6911+ Property ( x => x . SysEndTime ) . HasColumnName ( @"SysEndTime" ) . HasColumnType ( "datetime2" ) . IsRequired ( ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . Identity ) ;
6912+ }
6913+ }
6914+
6915+ // TemporalDepartmentHistory
6916+ public class TemporalDepartmentHistoryConfiguration : EntityTypeConfiguration < TemporalDepartmentHistory >
6917+ {
6918+ public TemporalDepartmentHistoryConfiguration ( )
6919+ : this ( "dbo" )
6920+ {
6921+ }
6922+
6923+ public TemporalDepartmentHistoryConfiguration ( string schema )
6924+ {
6925+ ToTable ( "TemporalDepartmentHistory" , schema ) ;
6926+ HasKey ( x => new { x . DeptId , x . DeptName , x . SysStartTime , x . SysEndTime } ) ;
6927+
6928+ Property ( x => x . DeptId ) . HasColumnName ( @"DeptID" ) . HasColumnType ( "int" ) . IsRequired ( ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . None ) ;
6929+ Property ( x => x . DeptName ) . HasColumnName ( @"DeptName" ) . HasColumnType ( "varchar" ) . IsRequired ( ) . IsUnicode ( false ) . HasMaxLength ( 50 ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . None ) ;
6930+ Property ( x => x . ManagerId ) . HasColumnName ( @"ManagerID" ) . HasColumnType ( "int" ) . IsOptional ( ) ;
6931+ Property ( x => x . ParentDeptId ) . HasColumnName ( @"ParentDeptID" ) . HasColumnType ( "int" ) . IsOptional ( ) ;
6932+ Property ( x => x . SysStartTime ) . HasColumnName ( @"SysStartTime" ) . HasColumnType ( "datetime2" ) . IsRequired ( ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . None ) ;
6933+ Property ( x => x . SysEndTime ) . HasColumnName ( @"SysEndTime" ) . HasColumnType ( "datetime2" ) . IsRequired ( ) . HasDatabaseGeneratedOption ( DatabaseGeneratedOption . None ) ;
6934+ }
6935+ }
6936+
68456937 // ThisIsMemoryOptimised
68466938 public class ThisIsMemoryOptimisedConfiguration : EntityTypeConfiguration < ThisIsMemoryOptimised >
68476939 {
0 commit comments