-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore hidden columns (used in SQL Server system versioned tables)
fixes #8192
- Loading branch information
Showing
6 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ore.SqlServer.Design.FunctionalTests/ReverseEngineering/Expected/SystemVersioned.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace E2ETest.Namespace | ||
{ | ||
public partial class SystemVersioned | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...Server.Design.FunctionalTests/ReverseEngineering/Expected/SystemVersionedContext.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
namespace E2ETest.Namespace | ||
{ | ||
public partial class SystemVersionedContext : DbContext | ||
{ | ||
public virtual DbSet<SystemVersioned> SystemVersioned { get; set; } | ||
|
||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
{ | ||
if (!optionsBuilder.IsConfigured) | ||
{ | ||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. | ||
optionsBuilder.UseSqlServer(@"{{connectionString}}"); | ||
} | ||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.Entity<SystemVersioned>(entity => | ||
{ | ||
entity.Property(e => e.Id).ValueGeneratedNever(); | ||
|
||
entity.Property(e => e.Name) | ||
.IsRequired() | ||
.HasColumnType("varchar(50)"); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters