Skip to content

Commit 19444cf

Browse files
committed
For tests add Relational Collation in OnModelCreating to expected contexts.
1 parent 3fe92bf commit 19444cf

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

sample/ScaffoldingSample/Contexts/NorthwindSlimContext.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
4343
{
4444
entity.ToTable("Category");
4545

46-
entity.HasComment("Hello table Customer\r\n(Currently not used.)");
47-
4846
entity.Property(e => e.CategoryName)
4947
.IsRequired()
50-
.HasMaxLength(15)
51-
.HasComment("Hello CompanyName\r\n(Currently not used.)");
48+
.HasMaxLength(15);
5249
});
5350

5451
modelBuilder.Entity<dbo.Customer>(entity =>

test/Scaffolding.Handlebars.Tests/ExpectedContexts.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
3232
3333
protected override void OnModelCreating(ModelBuilder modelBuilder)
3434
{
35+
modelBuilder.HasAnnotation(""Relational:Collation"", ""SQL_Latin1_General_CP1_CI_AS"");
36+
3537
modelBuilder.Entity<Category>(entity =>
3638
{
3739
entity.ToTable(""Category"");
@@ -94,6 +96,8 @@ public FakeDbContext(DbContextOptions<FakeDbContext> options) : base(options)
9496
9597
protected override void OnModelCreating(ModelBuilder modelBuilder)
9698
{
99+
modelBuilder.HasAnnotation(""Relational:Collation"", ""SQL_Latin1_General_CP1_CI_AS"");
100+
97101
modelBuilder.Entity<Category>(entity =>
98102
{
99103
entity.ToTable(""Category"");
@@ -165,6 +169,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
165169
166170
protected override void OnModelCreating(ModelBuilder modelBuilder)
167171
{
172+
modelBuilder.HasAnnotation(""Relational:Collation"", ""SQL_Latin1_General_CP1_CI_AS"");
173+
168174
modelBuilder.Entity<Category>(entity =>
169175
{
170176
entity.HasComment(""A category of products"");

test/Scaffolding.Handlebars.Tests/ExpectedTypeScriptContexts.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
3232
3333
protected override void OnModelCreating(ModelBuilder modelBuilder)
3434
{
35+
modelBuilder.HasAnnotation(""Relational:Collation"", ""SQL_Latin1_General_CP1_CI_AS"");
36+
3537
modelBuilder.Entity<Category>(entity =>
3638
{
3739
entity.ToTable(""Category"");

0 commit comments

Comments
 (0)