Skip to content

Commit 3fe92bf

Browse files
author
Anthony Sneed
committed
Update Sample.
1 parent 8d8477b commit 3fe92bf

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

sample/ScaffoldingSample/CodeTemplates/CSharpEntityType/Partials/Properties.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{#if nav-property-collection}}
2020
public virtual ICollection<{{nav-property-type}}> {{nav-property-name}} { get; set; }{{#if nullable-reference-types}} = default!;{{/if}}
2121
{{else}}
22-
public virtual {{nav-property-type}} {{nav-property-name}} { get; set; }{{#if nullable-reference-types}} = default!;{{/if}}
22+
public virtual {{nav-property-type}} {{nav-property-name}} { get; set; }{{#if nullable-reference-types}}{{#unless nav-property-isnullable}} = default!;{{/unless}}{{/if}}
2323
{{/if}}
2424
{{/each}}
2525
{{/if}}

sample/ScaffoldingSample/Contexts/NorthwindSlimContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
3737

3838
protected override void OnModelCreating(ModelBuilder modelBuilder)
3939
{
40+
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
41+
4042
modelBuilder.Entity<dbo.Category>(entity =>
4143
{
4244
entity.ToTable("Category");

sample/ScaffoldingSample/Models/dbo/Customer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public Customer()
1616
public string? City { get; set; }
1717
public Country Country { get; set; } = default!;
1818

19-
public virtual CustomerSetting CustomerSetting { get; set; } = default!;
19+
public virtual CustomerSetting? CustomerSetting { get; set; }
2020
public virtual ICollection<Order> Orders { get; set; } = default!;
2121

2222
// My Handlebars Block Helper: True

sample/ScaffoldingSample/Models/dbo/Order.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public Order()
1717
public int? ShipVia { get; set; }
1818
public decimal? Freight { get; set; }
1919

20-
public virtual Customer Customer { get; set; } = default!;
20+
public virtual Customer? Customer { get; set; }
2121
public virtual ICollection<OrderDetail> OrderDetails { get; set; } = default!;
2222

2323
// My Handlebars Block Helper: True

sample/ScaffoldingSample/Models/dbo/Product.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public Product()
1717
public bool Discontinued { get; set; } = default!;
1818
public byte[]? RowVersion { get; set; }
1919

20-
public virtual Category Category { get; set; } = default!;
20+
public virtual Category? Category { get; set; }
2121
public virtual ICollection<OrderDetail> OrderDetails { get; set; } = default!;
2222

2323
// My Handlebars Block Helper: True

sample/ScaffoldingSample/ScaffoldingDesignTimeServices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ScaffoldingDesignTimeServices : IDesignTimeServices
2121
public void ConfigureDesignTimeServices(IServiceCollection services)
2222
{
2323
// Uncomment to launch JIT debugger and hit breakpoints
24-
Debugger.Launch();
24+
//Debugger.Launch();
2525

2626
// Add Handlebars scaffolding templates
2727
services.AddHandlebarsScaffolding(options =>

0 commit comments

Comments
 (0)