Skip to content

Commit 3b5a857

Browse files
committed
Ah, got it working!
1 parent a2e4ce0 commit 3b5a857

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

EntityFramework.Reverse.POCO.Generator/EF.Reverse.POCO.Core.ttinclude

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,9 @@
10691069
: "System.ComponentModel.DataAnnotations.Schema.";
10701070

10711071
bool isNewSequentialId = !string.IsNullOrEmpty(Default) && Default.ToLower().Contains("newsequentialid");
1072+
bool isTemporalColumn = this.GeneratedAlwaysType != ColumnGeneratedAlwaysType.NotApplicable;
10721073

1073-
if (IsIdentity || isNewSequentialId)
1074+
if (IsIdentity || isNewSequentialId || isTemporalColumn) // Identity, instead of Computed, seems the best for Temporal `GENERATED ALWAYS` columns: https://stackoverflow.com/questions/40742142/entity-framework-not-working-with-temporal-table
10741075
{
10751076
if(Settings.UseDataAnnotations || isNewSequentialId)
10761077
DataAnnotations.Add("DatabaseGenerated(DatabaseGeneratedOption.Identity)");

0 commit comments

Comments
 (0)