Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update formatting code for double-nested lambdas #26349

Open
ajcvickers opened this issue Oct 14, 2021 · 2 comments
Open

Update formatting code for double-nested lambdas #26349

ajcvickers opened this issue Oct 14, 2021 · 2 comments
Labels
area-scaffolding punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-bug
Milestone

Comments

@ajcvickers
Copy link
Contributor

ajcvickers commented Oct 14, 2021

Currently the code doesn't handle indents correctly. For example, scaffolded temporal table configuration:

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<Blog>(entity =>
        {
            entity.ToTable(tb => tb.IsTemporal(ttb =>
    {
        ttb.UseHistoryTable("BlogsHistory", "dbo");
        ttb
            .HasPeriodStart("PeriodStart")
            .HasColumnName("PeriodStart");
        ttb
            .HasPeriodEnd("PeriodEnd")
            .HasColumnName("PeriodEnd");
    }
));
        });

        modelBuilder.Entity<Post>(entity =>
        {
            entity.ToTable(tb => tb.IsTemporal(ttb =>
    {
        ttb.UseHistoryTable("PostsHistory", "dbo");
        ttb
            .HasPeriodStart("PeriodStart")
            .HasColumnName("PeriodStart");
        ttb
            .HasPeriodEnd("PeriodEnd")
            .HasColumnName("PeriodEnd");
    }
));
@ajcvickers
Copy link
Contributor Author

/cc @maumar

@ajcvickers ajcvickers changed the title Bad formatting of scaffolded temporal table configuration Update formatting code for double-nested lambdas Oct 16, 2021
@ajcvickers ajcvickers added this to the Backlog milestone Oct 16, 2021
@bricelam bricelam self-assigned this Oct 20, 2021
@ajcvickers ajcvickers assigned maumar and unassigned bricelam Oct 27, 2021
@ajcvickers ajcvickers modified the milestones: Backlog, 7.0.0 Oct 27, 2021
@bricelam bricelam self-assigned this May 17, 2022
bricelam added a commit to bricelam/efcore that referenced this issue Jul 1, 2022
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 1, 2022
@bricelam
Copy link
Contributor

bricelam commented Jul 7, 2022

I made some progress on this in PR #28358. The lambda is now indented. But the indentation is a little weird since we don't break multi-line arguments into properly. Here are the remaining changes I'd like to see:

-                 entity.ToTable(tb => tb.IsTemporal(ttb =>
+                 entity.ToTable(
+                     tb => tb.IsTemporal(
+                         ttb =>
                          {
                              ttb.UseHistoryTable(""CustomerHistory"");
                              ttb
                                  .HasPeriodStart(""PeriodStart"")
                                  .HasColumnName(""PeriodStart"");
                              ttb
                                  .HasPeriodEnd(""PeriodEnd"")
                                  .HasColumnName(""PeriodEnd"");
                          }));

@bricelam bricelam added propose-punt and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels Jul 7, 2022
@bricelam bricelam removed this from the 7.0.0 milestone Jul 7, 2022
@ajcvickers ajcvickers added punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. and removed propose-punt labels Jul 9, 2022
@ajcvickers ajcvickers added this to the Backlog milestone Jul 9, 2022
bricelam added a commit to bricelam/efcore that referenced this issue Jul 11, 2022
@bricelam bricelam removed their assignment Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-scaffolding punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants