Skip to content

Commit

Permalink
Stop scaffolding DbSet initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
bricelam committed Aug 29, 2022
1 parent 1117c14 commit 9bcd2de
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public virtual string TransformText()
this.Write(this.ToStringHelper.ToStringWithCulture(entityType.Name));
this.Write("> ");
this.Write(this.ToStringHelper.ToStringWithCulture(entityType.GetDbSetName()));
this.Write(" { get; set; }");
this.Write(this.ToStringHelper.ToStringWithCulture(Options.UseNullableReferenceTypes ? " = null!;" : ""));
this.Write("\r\n\r\n");
this.Write(" { get; set; }\r\n\r\n");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public partial class <#= Options.ContextName #> : DbContext
foreach (var entityType in Model.GetEntityTypes().Where(e => !e.IsSimpleManyToManyJoinEntityType()))
{
#>
public virtual DbSet<<#= entityType.Name #>> <#= entityType.GetDbSetName() #> { get; set; }<#= Options.UseNullableReferenceTypes ? " = null!;" : "" #>
public virtual DbSet<<#= entityType.Name #>> <#= entityType.GetDbSetName() #> { get; set; }

<#
}
Expand Down
Loading

0 comments on commit 9bcd2de

Please sign in to comment.